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

_removed entry not sent with delta sync

    XMLWordPrintable

    Details

    • Sprint:
      CBG Sprint 26
    • Story Points:
      5

      Description

      The scenario is as follows:

      1. Start a SG instance with one user (autotest) assigned access to a particular channel (ABC)
      2. Create several documents on Couchbase Lite that get routed to the ABC channel
      3. Modify all the documents via SG HTTP so that they get routed to another channel instead (e.g. "unknown" channel)
      4. Run a pull replication on CBL

       

      With delta sync disabled this results in an exchange that finally ends in the following BLIP message for each revision:

      Frame Flags: Compressed|NoReply (0x28)
      Properties Length: 153
      Properties: history:1-f93627c3c7e953ef8d319b20cd7741cf9dad1c3e:Content-Type:application/json:Profile:rev:id:cbl_0:rev:2-8619ff078f2b2751592e4ffd45f262b7:sequence:12
      Message Body: {"_removed":true}

      However, with delta sync enabled the following gets sent instead:

      Frame Flags: Compressed|NoReply (0x28)
      Properties Length: 205
      Properties: Content-Type:application/json:Profile:rev:id:cbl_0:rev:2-58f62bd7e692d3f482ed9a9f9a775d48:sequence:12:history:1-e1d6c42d605810a2eb07da07ba3b022c326fb292:deltaSrc:1-e1d6c42d605810a2eb07da07ba3b022c326fb292
      Message Body: {"channels":{"0":"unknown"}}
      

      This results in the access removed event never getting triggered.  

        Attachments

          Issue Links

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

            Activity

            jimb Jim Borden created issue -
            adamf Adam Fraser made changes -
            Field Original Value New Value
            Assignee The One [ the one ] Adam Fraser [ adamf ]
            adamf Adam Fraser made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            adamf Adam Fraser made changes -
            Fix Version/s Cobalt [ 15420 ]
            adamf Adam Fraser made changes -
            Labels Blip delta-sync Blip backport-candidate delta-sync
            Hide
            adamf Adam Fraser added a comment -

            It looks like there are definitely two differences between GetDelta and GetRev that need to be included in the GetDelta processing:

            • The handling that returns a 404 missing when body and delta are nil, but no error is returned
            • The auth access check that triggers _removed handling 

            The following processing in GetRev doesn't need to be included:

            • History processing.  This is already covered based on the version of the history returned with the delta (delta.RevHistory)
            • The 404 deleted handling when revID isn't specified - revID will always be specified when a delta is being requested
            • _exp handling - showExp is currently always false for replications that support deltas 
            • attachmentsSince processing.  attachmentsSince is always nil for blip replication, as attachment retrieval is managed separately

            Given this, I think the best approach is to incorporate the first two into GetDelta (instead of trying to refactor into shared code).  It's probably feasible to pull the auth access handling into a shared function, but it doesn't make sense to try to completely reuse GetRev.

            Show
            adamf Adam Fraser added a comment - It looks like there are definitely two differences between GetDelta and GetRev that need to be included in the GetDelta processing: The handling that returns a 404 missing when body and delta are nil, but no error is returned The auth access check that triggers _removed handling  The following processing in GetRev doesn't need to be included: History processing.  This is already covered based on the version of the history returned with the delta (delta.RevHistory) The 404 deleted handling when revID isn't specified - revID will always be specified when a delta is being requested _exp handling - showExp is currently always false for replications that support deltas  attachmentsSince processing.  attachmentsSince is always nil for blip replication, as attachment retrieval is managed separately Given this, I think the best approach is to incorporate the first two into GetDelta (instead of trying to refactor into shared code).  It's probably feasible to pull the auth access handling into a shared function, but it doesn't make sense to try to completely reuse GetRev.
            ben.brooks Ben Brooks made changes -
            Assignee Adam Fraser [ adamf ] Ben Brooks [ ben.brooks ]
            ben.brooks Ben Brooks made changes -
            Sprint CBG Sprint 26 [ 854 ]
            ben.brooks Ben Brooks made changes -
            Rank Ranked higher
            ben.brooks Ben Brooks made changes -
            Story Points 5
            ben.brooks Ben Brooks made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            ben.brooks Ben Brooks made changes -
            Actual Start 2019-07-11 12:33 (issue has been started)
            ben.brooks Ben Brooks made changes -
            Rank Ranked higher
            daniel.petersen Daniel Petersen made changes -
            Fix Version/s 2.5.1 [ 16143 ]
            Hide
            daniel.petersen Daniel Petersen added a comment - - edited

            Can I get confirmation if this is the issue of https://issues.couchbase.com/browse/CBL-136 ?

            If so, I'll close the CBL issue.

            Show
            daniel.petersen Daniel Petersen added a comment - - edited Can I get confirmation if this is the issue of https://issues.couchbase.com/browse/CBL-136 ? If so, I'll close the CBL issue.
            Hide
            ben.brooks Ben Brooks added a comment -

            Daniel Petersen yes this looks like the issue reported by Pasin in the comments of CBL-136 - OK to close that out

            Show
            ben.brooks Ben Brooks added a comment - Daniel Petersen yes this looks like the issue reported by Pasin in the comments of CBL-136 - OK to close that out
            ben.brooks Ben Brooks made changes -
            Status In Progress [ 3 ] In Review [ 10107 ]
            Automated transition triggered when Ben Brooks created pull request #4190 in GitHub -
            Status In Review [ 10107 ] In Progress [ 3 ]
            ben.brooks Ben Brooks made changes -
            Status In Progress [ 3 ] In Review [ 10107 ]
            ben.brooks Ben Brooks made changes -
            Link This issue backports to CBG-450 [ CBG-450 ]
            Automated transition triggered when Ben Brooks created pull request #4192 in GitHub -
            Status In Review [ 10107 ] In Progress [ 3 ]
            ben.brooks Ben Brooks made changes -
            Status In Progress [ 3 ] In Review [ 10107 ]
            Automated transition triggered when Adam Fraser merged pull request #4192 in GitHub -
            Status In Review [ 10107 ] Resolved [ 5 ]
            Anonymous made changes -
            Actual End 2019-07-12 13:10 (issue has been closed)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.6.0-116 contains sync_gateway commit 2fbc69c with commit message:
            CBG-449 - Handle _removed documents under delta sync (#4190)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-116 contains sync_gateway commit 2fbc69c with commit message: CBG-449 - Handle _removed documents under delta sync (#4190)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.6.0-116 contains sync_gateway commit 2fbc69c with commit message:
            CBG-449 - Handle _removed documents under delta sync (#4190)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-116 contains sync_gateway commit 2fbc69c with commit message: CBG-449 - Handle _removed documents under delta sync (#4190)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.6.0-116 contains sync_gateway commit 2fbc69c with commit message:
            CBG-449 - Handle _removed documents under delta sync (#4190)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.6.0-116 contains sync_gateway commit 2fbc69c with commit message: CBG-449 - Handle _removed documents under delta sync (#4190)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.5.1-11 contains sync_gateway commit 5b72601 with commit message:
            CBG-450 - Backport CBG-449 to 2.5.1 (#4192)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.5.1-11 contains sync_gateway commit 5b72601 with commit message: CBG-450 - Backport CBG-449 to 2.5.1 (#4192)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.5.1-11 contains sync_gateway commit 5b72601 with commit message:
            CBG-450 - Backport CBG-449 to 2.5.1 (#4192)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.5.1-11 contains sync_gateway commit 5b72601 with commit message: CBG-450 - Backport CBG-449 to 2.5.1 (#4192)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.5.1-11 contains sync_gateway commit 5b72601 with commit message:
            CBG-450 - Backport CBG-449 to 2.5.1 (#4192)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.5.1-11 contains sync_gateway commit 5b72601 with commit message: CBG-450 - Backport CBG-449 to 2.5.1 (#4192)
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.5.1-11 contains sync_gateway commit 5b72601 with commit message:
            CBG-450 - Backport CBG-449 to 2.5.1 (#4192)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.5.1-11 contains sync_gateway commit 5b72601 with commit message: CBG-450 - Backport CBG-449 to 2.5.1 (#4192)
            ben.brooks Ben Brooks made changes -
            Status Resolved [ 5 ] Reopened [ 4 ]
            ben.brooks Ben Brooks made changes -
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Resolved [ 5 ]
            ben.brooks Ben Brooks made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              Assignee:
              ben.brooks Ben Brooks
              Reporter:
              jimb Jim Borden
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    PagerDuty