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

New attachment metadata not preserved on CAS retry during document update

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0, 2.5.1
    • Fix Version/s: 2.6.1
    • Component/s: SyncGateway
    • Security Level: Public
    • Required Mobile Fields:
      Hide
      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:
      Show
      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:
    • Story Points:
      3

      Description

      Need to attempt to reproduce a loss of attachment data in the following scenario:

      1. Document exists at some revision (3-a, say)
      2. A new revision arrives (4-a) via the REST API, adding attachments to the document
      3. Before that write completes, a write for revision 5-a arrives
      4. Revision 4-a completes, adding attachment and attachment metadata to the document
      5. The write for 5-a fails due to CAS, then retries
      6. On second attempt, the write for 5-a succeeds, but _attachments metadata is being lost

      This is only reported as happening in this particular CAS retry scenario. Should be feasible to write a unit test to try to reproduce this behaviour.

        Attachments

          Issue Links

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

            Activity

            Hide
            adamf Adam Fraser added a comment -

            Unit test for this scenario passes on master (2.7.0), but fails when running against 2.6.0 or 2.5.0. This issue may have been fixed as a side-effect of the updateDoc refactoring. Looking into exactly how it's failing in 2.5.0 to try to identify whether this is a backport candidate.

            Show
            adamf Adam Fraser added a comment - Unit test for this scenario passes on master (2.7.0), but fails when running against 2.6.0 or 2.5.0. This issue may have been fixed as a side-effect of the updateDoc refactoring. Looking into exactly how it's failing in 2.5.0 to try to identify whether this is a backport candidate.
            Hide
            adamf Adam Fraser added a comment -

            This was fixed in 2.7.0 as part of the changes in https://github.com/couchbase/sync_gateway/pull/4211. These are too significant to backport to a maintenance release, so if this issue needs to be fixed in 2.5.0 or 2.6.0, it will require a custom fix for those branches.

            Show
            adamf Adam Fraser added a comment - This was fixed in 2.7.0 as part of the changes in https://github.com/couchbase/sync_gateway/pull/4211 . These are too significant to backport to a maintenance release, so if this issue needs to be fixed in 2.5.0 or 2.6.0, it will require a custom fix for those branches.

              People

              Assignee:
              adamf Adam Fraser
              Reporter:
              adamf Adam Fraser
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    PagerDuty