mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-29 11:55:03 +01:00
pruner: handle replication cursor being older than any snapshot correctly
This commit is contained in:
parent
cb83a26c90
commit
9bb7b19c93
@ -402,7 +402,17 @@ fsloop:
|
|||||||
sort.Slice(tfsvs, func(i, j int) bool {
|
sort.Slice(tfsvs, func(i, j int) bool {
|
||||||
return tfsvs[i].CreateTXG < tfsvs[j].CreateTXG
|
return tfsvs[i].CreateTXG < tfsvs[j].CreateTXG
|
||||||
})
|
})
|
||||||
preCursor := true
|
|
||||||
|
haveCursorSnapshot := false
|
||||||
|
for _, tfsv := range tfsvs {
|
||||||
|
if tfsv.Type != pdu.FilesystemVersion_Snapshot {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if tfsv.Guid == rc.GetGuid() {
|
||||||
|
haveCursorSnapshot = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
preCursor := haveCursorSnapshot
|
||||||
for _, tfsv := range tfsvs {
|
for _, tfsv := range tfsvs {
|
||||||
if tfsv.Type != pdu.FilesystemVersion_Snapshot {
|
if tfsv.Type != pdu.FilesystemVersion_Snapshot {
|
||||||
continue
|
continue
|
||||||
@ -413,6 +423,7 @@ fsloop:
|
|||||||
l.WithError(pfs.err).Error("")
|
l.WithError(pfs.err).Error("")
|
||||||
continue fsloop
|
continue fsloop
|
||||||
}
|
}
|
||||||
|
// note that we cannot use CreateTXG because target and receiver could be on different pools
|
||||||
atCursor := tfsv.Guid == rc.GetGuid()
|
atCursor := tfsv.Guid == rc.GetGuid()
|
||||||
preCursor = preCursor && !atCursor
|
preCursor = preCursor && !atCursor
|
||||||
pfs.snaps = append(pfs.snaps, snapshot{
|
pfs.snaps = append(pfs.snaps, snapshot{
|
||||||
|
Loading…
Reference in New Issue
Block a user