You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// CVOutdated returns true if the provided CV does not match _sync.rev.ver and _sync.rev.src. The caller is responsible for testing if the values are non-empty.
665
-
// This compares _vv.ver and _vv.src to _sync.rev.ver and _sync.rev.src
// CVEqual returns true if the provided CV does not match _sync.rev.ver and _sync.rev.src. The caller is responsible for testing if the values are non-empty.
// IsSGWrite determines if a document was written by Sync Gateway or via an SDK. CV is an optional parameter to check. This would represent _vv.ver and _vv.src
@@ -713,23 +690,16 @@ func (s *SyncData) IsSGWrite(cas uint64, rawBody []byte, rawUserXattr []byte) (i
713
690
}
714
691
715
692
// IsSGWrite - used during on-demand import. Check SyncData and HLV to determine if the document was written by Sync Gateway or by a Couchbase Server SDK write.
base.DebugfCtx(ctx, base.KeyCRUD, "Doc %s is not an SG write, based on cas and body hash. cas:%d syncCas:%d", base.UD(doc.ID), doc.Cas, doc.SyncData.Cas)
// Doc wasn't a version vector before calling this function, so we can't use _sync.ver / _sync.src to determine if it was an SG write
727
-
returntrue, crc32MatchFeed, bodyChangedFeed
728
-
}
729
-
ifdoc.CVOutdated(cv.SourceID, cv.Value) {
730
-
base.DebugfCtx(ctx, base.KeyCRUD, "Doc %s is not an SG write, based on mismatch between version vector %#v and sync metadata %#v", base.UD(doc.ID), cv, doc.RevAndVersion)
base.DebugfCtx(ctx, base.KeyCRUD, "Doc %s is not an SG write, based on user xattr hash", base.UD(doc.ID))
763
733
returnfalse, true, false
764
734
}
765
-
ifdoc.CVOutdated(cv.SourceID, cv.Value) {
766
-
base.DebugfCtx(ctx, base.KeyCRUD, "Doc %s is not an SG write, based on version vector %#v not matching sync metadata cv %s", base.UD(doc.ID), cv, doc.RevAndVersion.CV())
base.DebugfCtx(ctx, base.KeyCRUD, "Doc %s is not an SG write, based on mismatch between version vector cv %s and sync metadata cv %s", base.UD(doc.ID), doc.HLV.GetCurrentVersionString(), doc.RevAndVersion.CV())
base.WarnfCtx(ctx, "Error parsing version xattr for doc %s - not importing. Continuing without doing version vector consistency check between _vv and _sync: %s", base.UD(event.Key), err)
0 commit comments