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

couch_dbdump outputs escape sequences instead of the collection id prefix

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 7.1.0
    • 7.1.0
    • couchbase-bucket
    • None
    • Triaged
    • 1
    • Unknown
    • KV 2021-Dec

    Description

      What is the issue?
      Currently, couch_dbdump outputs incorrect document IDs for several documents. Normally the format of the document ID in the output is (collection:0x[collection id in hex])[document key] or (collection:0x0:default)[document key] but for some documents it outputs [some escape sequence][document key].

      For example, in the travel-sample dataset there are several documents with the following escape sequences as prefixes in their IDs:

      \t, \r, \x0b, \x0f, and \x11
      

      This happens with and without --json flag:

      # Bad doc
      Doc seq: 98            
           id: \t34   
      # Good
      Doc seq: 97                                                                                                                                 
           id: (collection:0x0:default)route_7981                                                                                                 
      # Good
      Doc seq: 96                                                           
           id: (collection:0x14)route_6667
      

      b'{"seq":98,"id":"\t34","rev":1,"content_meta":00,"physical_size":524,"cas":"1637953940280836096","expiry":0,"flags":0,"datatype":3,"datatype_as_text":["snappy","json"],"size":516,"body":"{\\n  \\"name\\": \\"Tomas Haag\\",\\n  \\"addresses\\": [\\n    {\\n      \\"type\\": \\"home\\",\\n      \\"address\\": \\"94425 Feest Valleys\\",\\n      \\"city\\": \\"San Jose\\",\\n      \\"country\\": \\"United States\\"\\n    }\\n  ],\\n  \\"driving_licence\\": \\"ed93ad8d-31cf-5945-a564-d5c628f0c8e8\\",\\n  \\"passport\\": \\"f6a3d562-69a6-5937-8775-a7515a6be080\\",\\n  \\"preferred_email\\": \\"tomashaag@jotki.lu\\",\\n  \\"preferred_phone\\": \\"(429) 635-8856\\",\\n  \\"preferred_airline\\": \\"inventory.airline.airline_225\\",\\n  \\"preferred_airport\\": \\"inventory.airport.airport_3748\\",\\n  \\"credit_cards\\": [\\n    {\\n      \\"type\\": \\"Visa\\",\\n      \\"number\\": \\"4838291754780877\\",\\n      \\"expiration\\": \\"2021-11\\"\\n    },\\n    {\\n      \\"type\\": \\"Visa\\",\\n      \\"number\\": \\"4812898467217177\\",\\n      \\"expiration\\": \\"2021-08\\"\\n    }\\n  ],\\n  \\"created\\": \\"2020-09-06\\",\\n  \\"updated\\": \\"2021-02-19\\"\\n}"}'
      

      Steps to reproduce:

      1. Set up and configure a cluster with one data node
      2. Import the travel-sample sample bucket using web UI
      3. Run something like

        couch_dbdump ~/source/ns_server/data/n_0/data/travel-sample/*.couch.1 | grep id: -w | grep -E "collection:0x|scope" -v
        

        to get all of the invalid keys or

        couch_dbdump --json ~/cb/source/ns_server/data/n_0/data/travel-sample/*.couch.1 | grep id -w | grep -E "collection:0x|scope" -v
        

        to get all of the documents with invalid keys and their metadata in JSON format.

      Attachments

        Issue Links

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

          Activity

            People

              maks.januska Maksimiljans Januska
              maks.januska Maksimiljans Januska
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty