Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-1335

Mutating _rev on localDocument in conflict resolver results in merge error

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 3.0
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 78
    • 3

    Description

      resolveDocMerge extracts the previous local rev from the mutable conflict.localDocument.  However, this may have been modified by the conflict resolver.  As a result, conflict resolvers that return a modified localDocument (stripping out _rev) will result in an error like:

      Error resolving conflict for <ud>mydoc</ud>: Attempted to tombstone active revision for doc (mydoc), but provided rev () doesn't match current rev(14-f9841ac5d3bfa186fbd6f52d1f747cd8)
      Any code that works with Conflict after conflict resolution has run should treat it as mutated, and only use when appropriate (rev check for local/remote wins, and body for merge)

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            adamf Adam Fraser created issue -
            Ian.bridge Ian Bridge made changes -
            Field Original Value New Value
            Link This issue is triggering DOC-8236 [ DOC-8236 ]
            Automated transition triggered when ibsoln merged pull request #423 in GitHub -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            adamf Adam Fraser made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            daniel.petersen Daniel Petersen made changes -
            Required Mobile Fields Mandatory:
             - CBL / SG Version:
               - SG Config:
             - Steps to Reproduce:
             - Actual Result:
             - Expected Result:
             - Logs :
                  SGW LOGS: sgcollect info
                  CBL LOGS:
                  Logcat LOGS: for Android tickets
             - Github link for the code:
             - Jenkins job failure link:
             - Pytest Command
             - What is the last build this test passed:
            adamf Adam Fraser added a comment -

            A new test should be written to exercise this - have a conflict resolver that results in a merge, and also mutates the value of local.rev and/or remote.rev, and ensure that the mutated revisions aren't used post-conflict resolution.

            adamf Adam Fraser added a comment - A new test should be written to exercise this - have a conflict resolver that results in a merge, and also mutates the value of local.rev and/or remote.rev, and ensure that the mutated revisions aren't used post-conflict resolution.
            adamf Adam Fraser made changes -
            Assignee The One [ the one ] Jacques Rascagneres [ jacques.rascagneres ]
            adamf Adam Fraser made changes -
            Sprint CBG Sprint 78 [ 1691 ]
            adamf Adam Fraser made changes -
            Rank Ranked lower
            jacques.rascagneres Jacques Rascagneres made changes -
            Status Reopened [ 4 ] In Progress [ 3 ]
            Automated transition triggered when Jacques Rascagneres created pull request #5118 in GitHub -
            Status In Progress [ 3 ] In Review [ 10107 ]
            jacques.rascagneres Jacques Rascagneres made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10107 ] Resolved [ 5 ]

            Build sync_gateway-3.0.0-301 contains sync_gateway commit e96fcbb with commit message:
            CBG-1335: Use appropriate rev when utilizing a custom conflict resolver (#5118)

            build-team Couchbase Build Team added a comment - Build sync_gateway-3.0.0-301 contains sync_gateway commit e96fcbb with commit message: CBG-1335 : Use appropriate rev when utilizing a custom conflict resolver (#5118)
            adamf Adam Fraser made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

            People

              jacques.rascagneres Jacques Rascagneres
              adamf Adam Fraser
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty