The problem:
Snapshots are not taken atomicly. Each object in the config file is taking individually.
Example:
DatasetA has a database
DatasetB has a file repository
A snapshot of DatasetA is taken
Both datasets are updated (database update, file added to repository)
A snapshot of DatasetB is taken
Your datasets are now out of sync. The database update is not saved, so the file added to the repo is orphaned.
Example 2:
DatasetA has a database
DatasetB has a file repository
A snapshot of DatasetB is taken
Both datasets are updated (database update, file added to repository)
A snapshot of DatasetA is taken
Your datasets are now out of sync. The database update is saved, but the file repo update is not, leaving orphaned data in the database. This is worse than the above.
Possible fix:
Take all the snapshots in a single command. As all the snapshots are pushed to an array n sanoid, this should need only minor changes near system($zfs, "snapshot", "$snap");
This is also needs fixing in syncoid, something around my $snapcmd = "$rhost $mysudocmd $zfscmd snapshot $fs\@$snapname\n";
This should not change expiring.