mirror of https://github.com/jimsalterjrs/sanoid
Fix bug when comparing snapshot and bookmark creation times
This commit fixes a bug introduced in commit
522bdecd53
Creation times of snapshots have a three digit suffix while bookmark
creation times do not. This leads to the comparison always being true.
This commit is contained in:
parent
6b9fca6a76
commit
a669ba11ca
8
syncoid
8
syncoid
|
|
@ -699,11 +699,9 @@ sub syncdataset {
|
|||
# do an replication to it and replicate as always from oldest to newest
|
||||
# because bookmark sends doesn't support intermediates directly
|
||||
foreach my $snap ( sort { sortsnapshots(\%snaps, $a, $b, 'source') } keys %{ $snaps{'source'} }) {
|
||||
my $comparisonkey = 'creation';
|
||||
if (defined $snaps{'source'}{$snap}{'createtxg'} && defined $bookmark{'createtxg'}) {
|
||||
$comparisonkey = 'createtxg';
|
||||
}
|
||||
if ($snaps{'source'}{$snap}{$comparisonkey} >= $bookmark{$comparisonkey}) {
|
||||
my $comparetxg = defined $snaps{'source'}{$snap}{'createtxg'} && defined $bookmark{'createtxg'};
|
||||
if (($comparetxg && $snaps{'source'}{$snap}{'createtxg'} >= $bookmark{'createtxg'}) ||
|
||||
substr($snaps{'source'}{$snap}{'creation'}, 0, -3) >= $bookmark{'creation'}) {
|
||||
$nextsnapshot = $snap;
|
||||
last;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue