Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-7631

Bodies for deleted documents shouldn't be read (causes garbage data to be read)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: storage-engine
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Observed on Mac and Linux platforms

      Description

      Steps to reproduce:

      1. Set up XDCR (observed when sending to ElasticSearch but not believe to be related to this)
      2. Create JSON document
      3. Observe that document is replicated as expected to remote side

      [{meta=

      {id=2, rev=2-000015818d7d3c0a0000000000000000, expiration=0, flags=0}

      , base64=eyJjbGljayI6InRvIGVkaXQiLCJuZXcgaW4gMi4wIjoidGhlcmUgYXJlIG5vIHJlc2VydmVkIGZpZWxkIG5hbWVzIn0=}]

      in the _bulk_docs request the document appears to be JSON and the base64 data correctly represents the document

      4. Delete the document
      5. Observe that the document deletion is replicated across to remote side, but with some unusual settings:

      [{meta=

      {id=2, rev=3-000015818d7d3c0b0000000000000000, att_reason=non-JSON mode, expiration=0, flags=0, deleted=true}

      , base64=V1QBAOAAAENfbG9jYWwvdmJzdGF0ZXsiBQdoIjogImFjdGl2ZSIsICJjaGVja3BvaW50X2lkARsAMQEWXG1heF9kZWxldGVkX3NlcW5vIjogIjAifQ==}]

      Note that the document is indicated as binary (non-JSON mode) and that the the base64 encoded data appears to be some random memory on the server:

      echo "V1QBAOAAAENfbG9jYWwvdmJzdGF0ZXsiBQdoIjogImFjdGl2ZSIsICJjaGVja3BvaW50X2lkARsAMQEWXG1heF9kZWxldGVkX3NlcW5vIjogIjAifQ==" | base64 -D
      WT?C_local/vbstate

      {"h": "active", "checkpoint_id\max_deleted_seqno": "0"}
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        junyi Junyi Xie (Inactive) added a comment -

        I am ok with that. But the fix is in couchdb so Filipe should make the final decision.

        Show
        junyi Junyi Xie (Inactive) added a comment - I am ok with that. But the fix is in couchdb so Filipe should make the final decision.
        Hide
        FilipeManana Filipe Manana (Inactive) added a comment -

        Yes, fine for me.

        Show
        FilipeManana Filipe Manana (Inactive) added a comment - Yes, fine for me.
        Hide
        thuan Thuan Nguyen added a comment -

        Integrated in github-couchdb-preview #563 (See http://qa.hq.northscale.net/job/github-couchdb-preview/563/)
        MB-7631 Interpret bp of 0 as empty body (Revision c086371a81e43021966620c469134e08530fe38a)
        Revert "MB-7631 Interpret bp of 0 as empty body" (Revision bfd853e859ab961f8ee6c8fb8b38e667b3dd0a9c)

        Result = SUCCESS
        Filipe David Borba Manana :
        Files :

        • src/couchdb/couch_db.erl

        Filipe David Borba Manana :
        Files :

        • src/couchdb/couch_db.erl
        Show
        thuan Thuan Nguyen added a comment - Integrated in github-couchdb-preview #563 (See http://qa.hq.northscale.net/job/github-couchdb-preview/563/ ) MB-7631 Interpret bp of 0 as empty body (Revision c086371a81e43021966620c469134e08530fe38a) Revert " MB-7631 Interpret bp of 0 as empty body" (Revision bfd853e859ab961f8ee6c8fb8b38e667b3dd0a9c) Result = SUCCESS Filipe David Borba Manana : Files : src/couchdb/couch_db.erl Filipe David Borba Manana : Files : src/couchdb/couch_db.erl
        Hide
        thuan Thuan Nguyen added a comment -

        Integrated in github-couchdb-preview #564 (See http://qa.hq.northscale.net/job/github-couchdb-preview/564/)
        MB-7631 Interpret bp of 0 as empty body (Revision 8e961880696e0398229e7a837344b73053beed84)

        Result = SUCCESS
        Filipe David Borba Manana :
        Files :

        • src/couchdb/couch_db.erl
        Show
        thuan Thuan Nguyen added a comment - Integrated in github-couchdb-preview #564 (See http://qa.hq.northscale.net/job/github-couchdb-preview/564/ ) MB-7631 Interpret bp of 0 as empty body (Revision 8e961880696e0398229e7a837344b73053beed84) Result = SUCCESS Filipe David Borba Manana : Files : src/couchdb/couch_db.erl
        Hide
        jin Jin Lim (Inactive) added a comment -
        Show
        jin Jin Lim (Inactive) added a comment - http://review.couchbase.org/#/c/24586/ merged.

          People

          • Assignee:
            FilipeManana Filipe Manana (Inactive)
            Reporter:
            mschoch Marty Schoch
          • Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes