freenas/freenas — pull request #6 by rkojedzinszky (2013-04-10 12:57:45+00:00)
Title: Fix for recursive replication with multiple snapshot schedules

This fixes problems when using -R replications.

In a scenario where in the same timestamp two or more snapshots were
created for a dataset, the replication could fail, because when checking
the remote side, another snapshots might get replicated, and due to the
ordering bad results came back.

Example:
~# zfs snapshot test@a && zfs snapshot test@b && sleep 1 && zfs snapshot test@c
~# zfs list -t snapshot -d 1 -H -o name test
test@a
test@b
test@c
~# zfs list -t snapshot -d 1 -H -o name -s creation test
test@a
test@b
test@c
~# zfs list -t snapshot -d 1 -H -o name -S creation test
test@c
test@a
test@b

As shown, the reverse ordering, or maybe any ordering breaks zfs
snapshot dependencies in the listing.