endpoint: fix ListStale for step-* abstractions by using replication cursors and falling back to step holds for initial replication

This commit is contained in:
Christian Schwarz
2020-04-06 12:50:11 +02:00
parent ac2eb9f86b
commit f5f94219fd
4 changed files with 120 additions and 47 deletions
+1
View File
@@ -234,6 +234,7 @@ func resolveConflict(conflict error) (path []*pdu.FilesystemVersion, msg string)
if noCommonAncestor, ok := conflict.(*ConflictNoCommonAncestor); ok {
if len(noCommonAncestor.SortedReceiverVersions) == 0 {
// TODO this is hard-coded replication policy: most recent snapshot as source
// NOTE: Keep in sync with listStaleFiltering, it depends on this hard-coded assumption
var mostRecentSnap *pdu.FilesystemVersion
for n := len(noCommonAncestor.SortedSenderVersions) - 1; n >= 0; n-- {
if noCommonAncestor.SortedSenderVersions[n].Type == pdu.FilesystemVersion_Snapshot {