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

Updating a blob with new data does not update SG's metadata on sync

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.5.1, 2.7.2
    • 3.0
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 61, CBG Sprint 62
    • 3

    Description

      Reported here: https://forums.couchbase.com/t/updating-blob-is-not-including-metadata/24012

      and here: https://forums.couchbase.com/t/metadata-error-when-updating-attachments-with-a-file-already-used-previously/25364

       

      It looks like creating a document with a blob, pushing it up to SG, and then updating that blob with new data that already exists in another doc does not send the updated metadata to Sync Gateway.

      Need to try and repro using an Android Lite client (both reporters were using Android, which may provide a clue), and see whether it's a SG or Lite issue.

      Attachments

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

        Activity

          ben.brooks Ben Brooks added a comment - Update: Looks like this may be related to attachments larger than 20MB https://forums.couchbase.com/t/metadata-error-when-updating-attachments-with-a-file-already-used-previously/25364/3?u=bbrks

          Managed to reproduce image with Sync Gateway master and CBL Android 2.7.0:

          • Create doc1
          • Create doc2
          • Add attachment 1 to doc 1
          • Add attachment 1 to doc 2
          • Start Replication
          • Stop Replication when complete
          • Add attachment 2 to doc 1
          • Start Replication
          • Stop Replication when complete
          • Add attachment 1 to doc 1
          • Start Replication
          • Stop Replication when complete

          View Doc1 in couchbase server. The sync metadata attachment digest will be different to the one in the document body. The document body will be correct however the sync metadata will still have the digest from attachment2.
          These steps can almost definitely be simplified but it can be repro'd. 

          jacques.rascagneres Jacques Rascagneres added a comment - Managed to reproduce image with Sync Gateway master and CBL Android 2.7.0: Create doc1 Create doc2 Add attachment 1 to doc 1 Add attachment 1 to doc 2 Start Replication Stop Replication when complete Add attachment 2 to doc 1 Start Replication Stop Replication when complete Add attachment 1 to doc 1 Start Replication Stop Replication when complete View Doc1 in couchbase server. The sync metadata attachment digest will be different to the one in the document body. The document body will be correct however the sync metadata will still have the digest from attachment2. These steps can almost definitely be simplified but it can be repro'd. 

          Simplified steps:

          • Create doc1
          • Create doc2
          • Add attachment A to doc1
          • Add attachment B to doc2
          • Sync with replication
          • Add attachment B to doc1
          • Sync with replication

          Confirm metadata vs doc body mismatch for doc1 attachment

          jacques.rascagneres Jacques Rascagneres added a comment - Simplified steps: Create doc1 Create doc2 Add attachment A to doc1 Add attachment B to doc2 Sync with replication Add attachment B to doc1 Sync with replication Confirm metadata vs doc body mismatch for doc1 attachment

          Build sync_gateway-3.0.0-63 contains sync_gateway commit de4769c with commit message:
          CBG-789: Update attachment change with same name (#4860)

          build-team Couchbase Build Team added a comment - Build sync_gateway-3.0.0-63 contains sync_gateway commit de4769c with commit message: CBG-789 : Update attachment change with same name (#4860)

          People

            jacques.rascagneres Jacques Rascagneres
            ben.brooks Ben Brooks
            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