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

cbrestore doesn't restore view definitions taken via cbbackup

    XMLWordPrintable

Details

    • Untriaged
    • Yes

    Description

      Steps to reproduce:

      • Load any sample bucket, say beer-sample.
      • Take backup using cbbackup locally via

      ./cbbackup http://localhost:8091 ~/backup1 -u Administrator -p couchbase -vvv
      

      • Delete all design documents for the bucket.
      • Run cbrestore with or without design_doc_only option:

      ./cbrestore ~/backup1 http://127.0.0.1:8091 -x design_doc_only=1 -b beer-sample -u Administrator -p couchbase -vvv
      

      • Cannot see any design docs in the UI. Neither are the corresponding files created on the server.

      Following are the logs generated for the above cbrestore command for 6.0.0:

      ./cbrestore ~/backup1 http://127.0.0.1:8091 -x design_doc_only=1 -b beer-sample -u Administrator -p couchbase -vvv
      2018-12-20 05:15:37,883: mt cbrestore...
      2018-12-20 05:15:37,884: mt  source : /home/vagrant/backup1
      2018-12-20 05:15:37,884: mt  sink   : http://127.0.0.1:8091
      2018-12-20 05:15:37,884: mt  opts   : {'username': '<xxx>', 'verbose': 3, 'extra': {'max_retry': 10.0, 'rehash': 0.0, 'dcp_consumer_queue_length': 1000.0, 'data_only': 0.0, 'uncompress': 0.0, 'nmv_retry': 1.0, 'conflict_resolve': 1.0, 'cbb_max_mb': 100000.0, 'report': 5.0, 'mcd_compatible': 1.0, 'try_xwm': 1.0, 'backoff_cap': 10.0, 'batch_max_bytes': 400000.0, 'report_full': 2000.0, 'flow_control': 1.0, 'batch_max_size': 1000.0, 'seqno': 0.0, 'design_doc_only': 1.0, 'allow_recovery_vb_remap': 0.0, 'recv_min_bytes': 4096.0}, 'collection': None, 'ssl': False, 'threads': 4, 'to_date': None, 'key': None, 'password': '<xxx>', 'id': None, 'bucket_source': 'beer-sample', 'silent': False, 'dry_run': False, 'from_date': None, 'bucket_destination': None, 'add': False, 'vbucket_list': None, 'separator': '::'}
      2018-12-20 05:15:37,884: mt source_class: <class 'pump_bfd.BFDSource'>
      2018-12-20 05:15:37,885: mt sink_class: <class 'pump_cb.CBSink'>
      2018-12-20 05:15:37,896: mt Starting new HTTP connection (1): 127.0.0.1
      2018-12-20 05:15:37,900: mt "GET /pools/default/buckets HTTP/1.1" 200 10043
      2018-12-20 05:15:37,902: mt source_bucket: beer-sample
      2018-12-20 05:15:37,902: mt sink_bucket: beer-sample
      2018-12-20 05:15:37,902: mt source_buckets: beer-sample
      2018-12-20 05:15:37,902: mt bucket_source: beer-sample
      2018-12-20 05:15:37,902: mt source_buckets filtered: beer-sample
      2018-12-20 05:15:37,902: mt bucket: beer-sample
      transfer design doc only. bucket msgs will be skipped.
      done
      

      And following are the logs generated for a successful run where data was backed up and restored from an earlier version, 5.1.1:

      vagrant@node1-cb511-ubuntu14:/tmp/backup/bucket-travel-sample$ /opt/couchbase/bin/cbrestore /tmp/backup http://127.0.0.1:8091 -x design_doc_only=1 -b travel-sample -u Administrator -p password -vvv
      2018-12-20 04:22:58,732: mt cbrestore...
      2018-12-20 04:22:58,732: mt  source : /tmp/backup
      2018-12-20 04:22:58,733: mt  sink   : http://127.0.0.1:8091
      2018-12-20 04:22:58,734: mt  opts   : {'username': '<xxx>', 'verbose': 3, 'extra': {'max_retry': 10.0, 'rehash': 0.0, 'dcp_consumer_queue_length': 1000.0, 'data_only': 0.0, 'uncompress': 0.0, 'nmv_retry': 1.0, 'conflict_resolve': 1.0, 'cbb_max_mb': 100000.0, 'report': 5.0, 'mcd_compatible': 1.0, 'try_xwm': 1.0, 'backoff_cap': 10.0, 'batch_max_bytes': 400000.0, 'report_full': 2000.0, 'flow_control': 1.0, 'batch_max_size': 1000.0, 'seqno': 0.0, 'design_doc_only': 1.0, 'allow_recovery_vb_remap': 0.0, 'recv_min_bytes': 4096.0}, 'collection': None, 'ssl': False, 'threads': 4, 'to_date': None, 'key': None, 'password': '<xxx>', 'id': None, 'bucket_source': 'travel-sample', 'silent': False, 'dry_run': False, 'from_date': None, 'bucket_destination': None, 'add': False, 'vbucket_list': None, 'separator': '::'}
      2018-12-20 04:22:58,735: mt source_class: <class 'pump_bfd.BFDSource'>
      2018-12-20 04:22:58,735: mt sink_class: <class 'pump_cb.CBSink'>
      2018-12-20 04:22:58,741: mt Starting new HTTP connection (1): 127.0.0.1
      2018-12-20 04:22:58,745: mt "GET /pools/default/buckets HTTP/1.1" 200 10023
      2018-12-20 04:22:58,747: mt source_bucket: travel-sample
      2018-12-20 04:22:58,747: mt sink_bucket: travel-sample
      2018-12-20 04:22:58,747: mt source_buckets: travel-sample
      2018-12-20 04:22:58,748: mt bucket_source: travel-sample
      2018-12-20 04:22:58,748: mt source_buckets filtered: travel-sample
      2018-12-20 04:22:58,748: mt bucket: travel-sample
      transfer design doc only. bucket msgs will be skipped.
      2018-12-20 04:22:58,749: mt design_doc row: {u'controllers': {u'compact': u'/pools/default/buckets/travel-sample/ddocs/_design%2Fdev_a/controller/compactView', u'setUpdateMinChanges': u'/pools/default/buckets/travel-sample/ddocs/_design%2Fdev_a/controller/setUpdateMinChanges'}, u'doc': {u'json': {u'views': {u'a': {u'map': u'function (doc, meta) {\n  emit(meta.id, null);\n}'}}}, u'meta': {u'rev': u'2-c362e223', u'id': u'_design/dev_a'}}}
      2018-12-20 04:22:58,749: mt design_doc: {"views": {"a": {"map": "function (doc, meta) {\n  emit(meta.id, null);\n}"}}}
      2018-12-20 04:22:58,750: mt design_doc id: _design/dev_a at: /travel-sample%2B84a31a2dae6f5d1b9c8cbdb93a09cd37/_design/dev_a
      2018-12-20 04:22:58,750: mt rest_request: Administrator@127.0.0.1:8092/travel-sample%2B84a31a2dae6f5d1b9c8cbdb93a09cd37/_design/dev_a; reason: consume_design
      2018-12-20 04:22:58,853: mt design_doc created at: /travel-sample%2B84a31a2dae6f5d1b9c8cbdb93a09cd37/_design/dev_a
      2018-12-20 04:22:58,857: mt Starting new HTTP connection (1): 127.0.0.1
      2018-12-20 04:22:58,859: mt "GET /pools/default/nodeServices HTTP/1.1" 200 337
      2018-12-20 04:22:58,861: mt Starting new HTTP connection (1): 127.0.0.1
      2018-12-20 04:22:58,960: mt "POST /restoreIndexMetadata?bucket=travel-sample HTTP/1.1" 200 18
      done
      

      Note that the log statement in the successful run, printing the contents of the ddoc.json file created by cbbackup, which is not present in the unsuccessful run.

      2018-12-20 04:22:58,749: mt design_doc row: {u'controllers': {u'compact': u'/pools/default/buckets/travel-sample/ddocs/_design%2Fdev_a/controller/compactView', u'setUpdateMinChanges': u'/pools/default/buckets/travel-sample/ddocs/_design%2Fdev_a/controller/setUpdateMinChanges'}, u'doc': {u'json': {u'views': {u'a': {u'map': u'function (doc, meta) {\n  emit(meta.id, null);\n}'}}}, u'meta': {u'rev': u'2-c362e223', u'id': u'_design/dev_a'}}}
      

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-32419
          # Subject Branch Project Status CR V

          Activity

            No work has yet been logged on this issue.

            People

              thuan Thuan Nguyen
              abhishek.jindal Abhishek Jindal
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty