Skip to content

Commit

Permalink
Fix bug when comparing snapshot and bookmark creation times
Browse files Browse the repository at this point in the history
This commit fixes a bug introduced in commit
522bdec

Creation times of snapshots have a three digit suffix while bookmark
creation times do not. This leads to the comparison always being true.
  • Loading branch information
0xFelix committed May 17, 2023
1 parent d788383 commit 7d88f5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syncoid
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ 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 { $snaps{'source'}{$a}{'creation'}<=>$snaps{'source'}{$b}{'creation'} } keys %{ $snaps{'source'} }) {
if ($snaps{'source'}{$snap}{'creation'} >= $bookmarkcreation) {
if (substr($snaps{'source'}{$snap}{'creation'}, 0, -3) >= $bookmarks{$bookmarkguid}{'creation'}) {
$nextsnapshot = $snap;
last;
}
Expand Down

0 comments on commit 7d88f5c

Please sign in to comment.