-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-actor/Conflict tests and BTC pull replication conflict resolution #7286
base: release/anemone
Are you sure you want to change the base?
Conversation
2234e45
to
af9c239
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot this was a WIP, please feel free to disregard comments if irrelevant.
56b325c
to
cfa0bfb
Compare
return DocMetadataFromDocument(doc), doc.Body(ctx) | ||
var body db.Body | ||
if !doc.IsDeleted() { | ||
body = doc.Body(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be nil when this occurs, are we intentionally returning empty body rather than nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some commentary on this change in the CouchbaseLiteMockPeer
implementation - since for a tombstone body, there were variations of []byte({})
vs nil
vs []byte{}
.
I don't think it really matters as long as all peers treat it the same. It was required sincd waitForConvergingVersion
is also comparing doc bodies.
// GetDocument returns the latest version of a document. The test will fail the document does not exist.
func (p *CouchbaseLiteMockPeer) GetDocument(dsName sgbucket.DataStoreName, docID string) (DocMetadata, db.Body) {
bodyBytes, meta := p.getLatestDocVersion(dsName, docID)
require.NotNil(p.TB(), meta, "docID:%s not found on %s", docID, p)
var body db.Body
// it's easier if all clients can return consistent bodies for tombstones
// lets just settle on nil, since we still need special handling anyway for `` vs `{}` so unmarshal doesn't barf
func FromHistoryForHLV(history string) (*HybridLogicalVector, error) { | ||
hlv := NewHybridLogicalVector() | ||
// split the history string into PV and MV | ||
versionSets := strings.Split(history, ";") | ||
switch len(versionSets) { | ||
case 0: | ||
// no versions present | ||
return hlv, nil | ||
case 2: | ||
// MV | ||
mvs := strings.Split(versionSets[1], ",") | ||
for _, mv := range mvs { | ||
v, err := ParseVersion(mv) | ||
if err != nil { | ||
return nil, err | ||
} | ||
hlv.MergeVersions[v.SourceID] = v.Value | ||
} | ||
fallthrough |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was for pre-beta implementation and needs removing/changing
…ring out already known revs
… converging versions
…one in conflict to a non-deletion client doc
…multiple mv and pv are present
854ce7a
to
f7014ad
Compare
Enable multi-actor and conflict tests and allow BlipTesterClient to resolve conflicts and push up as new version.
Spun off two failing subtests into new ticket (CBG-4458) to get other improvements into
release/anemone