Skip to content

Conversation

@gregns1
Copy link
Contributor

@gregns1 gregns1 commented Dec 1, 2025

CBG-4905

  • Alter blip tester client to account for local or remote tombstones when resolving conflict.
  • Required changes to the resurrection testing to account for CBL peer resolving in favour of a tombstone

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

  • Link upstream PRs
  • Update Go module dependencies when merged

Integration Tests

Copilot AI review requested due to automatic review settings December 1, 2025 15:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the default conflict resolver for the BLIP tester to handle tombstones when resolving conflicts. The changes ensure that when either the local or remote document is a tombstone, the conflict resolution favors the non-deleted document.

  • Updated _resolveConflictLWW to prioritize non-deleted documents over tombstones during conflict resolution
  • Added helper functions to determine when conflicts are expected in CBL topologies
  • Modified resurrection test logic to handle tombstone convergence when CBL resolves in favor of its own tombstone

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
rest/utilities_testing_blip_client.go Enhanced conflict resolver to check for tombstones and prefer non-deleted documents
topologytest/peer_test.go Added helper functions to identify server-side peers and determine expected conflicts in CBL topologies
topologytest/multi_actor_no_conflict_test.go Updated resurrection test to wait for tombstone convergence when CBL conflicts are expected

Comment on lines +141 to +139
if delPeerName == "cbl1" {
// cbl delete will mean cbs resurrect has a conflict
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using strings.Contains(delPeerName, \"cbl\") or a constant for "cbl1" to avoid hardcoding the peer name and improve maintainability.

Suggested change
if delPeerName == "cbl1" {
// cbl delete will mean cbs resurrect has a conflict
// If the delete peer is a Couchbase Lite peer, conflict is expected.
if strings.HasPrefix(delPeerName, "cbl") {

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants