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

Views cannot index existing data after reboot due to change in 'type'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.0.0
    • 4.0.0
    • Security Level: Public
    • single node running ubuntu 12.04
    • Untriaged
    • Ubuntu 64-bit
    • Yes
    • Mar 9 - Mar 27

    Description

      Sherlock build 1273: couchbase-server-enterprise_3.5.0-1273-ubuntu12.04_amd64.deb

      After a node is rebooted, any new views created are unable to index existing data that was re-loaded as part of warmup.

      It appears that the view engine is incorrectly identifying the type of the document after reboot.

      Full details are below, after steps to reproduce.

      Steps to reproduce:

      • Load a sample data set such as beer-sample.
      • Create a new view e.g. by name:
        function (doc, meta) {
        if (doc.name) { emit(doc.name); }
        }

        - Look at view results, they successfully show all data.
        - Create a new view that emits the metadata for one specific key (same for all keys, but focusing in on one):
        function (doc, meta) {
        if (meta.id == '21st_amendment_brewery_cafe') { emit(meta); }
        }

        - Look at the results, see that the "type" is JSON.

        reboot the node

        - Create a new view (same function for consistency, but with a new view name) :
        function (doc, meta) {
        if (doc.name) { emit(doc.name); }


        }

      • Look at view results, there are no rows returned! {"total_rows":0,"rows":[]}
      • Create a new view that emits the metadata for one specific key (same for all keys, but focusing in on one):
        function (doc, meta) {
        if (meta.id == '21st_amendment_brewery_cafe') { emit(meta); }


        }

      Look at the results, see that the "type" is base64.

      – somehow after reboot the view engine is now detecting the type as base64, where as before it was JSON.


                                                              • Further details:

      Note that the flags, datatype and cas have not changed between reboots:

      Document metadata from disk using couchdb_dump before reboot:

      root@precise64:/home/vagrant# /opt/couchbase/bin/couch_dbdump --no-body --json --key 21st_amendment_brewery_cafe /opt/couchbase/var/lib/couchbase/data/beer-sample/553.couch.1
      Dumping "/opt/couchbase/var/lib/couchbase/data/beer-sample/553.couch.1":

      {"seq":4,"id":"21st_amendment_brewery_cafe","rev":1,"content_meta":128,"physical_size":633,"cas":"1424204128193806337","expiry":0,"flags":0,"datatype":1,"conflict_resolution_mode":0,"body":null}

      Document metadata from memory before reboot using getMeta tool:
      bash-3.2$ lib/python/getMeta/getMeta.py -s 192.168.110.101 -p 11210 -b beer-sample 21st_amendment_brewery_cafe
      key '21st_amendment_brewery_cafe': deleted:0 flags:0 exp:0 seqno:1 cas:1424204128193806337

      after reboot these are all the same

      Metadata form couchdb_dump:
      root@precise64:/opt/couchbase/bin# /opt/couchbase/bin/couch_dbdump --no-body --json --key 21st_amendment_brewery_cafe /opt/couchbase/var/lib/couchbase/data/beer-sample/553.couch.1
      Dumping "/opt/couchbase/var/lib/couchbase/data/beer-sample/553.couch.1":

      {"seq":4,"id":"21st_amendment_brewery_cafe","rev":1,"content_meta":128,"physical_size":633,"cas":"1424204128193806337","expiry":0,"flags":0,"datatype":1,"conflict_resolution_mode":0,"body":null}

      Metadata from memory:

      bash-3.2$ lib/python/getMeta/getMeta.py -s 192.168.110.101 -p 11210 -b beer-sample 21st_amendment_brewery_cafe
      key '21st_amendment_brewery_cafe': deleted:0 flags:0 exp:0 seqno:1 cas:1424204128193806337

      Attachments

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

        Activity

          People

            tom.green Tom Green (Inactive)
            tom.green Tom Green (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty