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

documents showing twice in view results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 2.1.0
    • 2.0.1
    • view-engine
    • Security Level: Public
    • None
    • MacBook Pro
    • MacOSX 64-bit

    Description

      When views are queried rapidly (in this case twice a second) while documents are being modified (in this case INCR) it can happen that some documents are present in the view results more than once.

      The attached test script can be run by unzipping it and then, from inside the directory running:

      > npm install
      > npm start

      Note that you'll have to install the node.js couchbase driver to run the test, which depends on having libcouchbase installed. And if you run into issues you may have to symlink libcouchbase and other .o files into a different /usr/local ... at least on my mac I had to run this kind of stuff to get it to build correctly:

      sudo ln -s /opt/boxen/homebrew/Cellar/nspr/4.9.3/lib/libnspr4.dylib /usr/local/lib/libnspr4.dylib
      sudo ln -s /opt/boxen/homebrew/Cellar/spidermonkey/1.8.5/lib/libmozjs185.1.0.0.dylib /usr/local/lib/libmozjs185.1.0.0.dylib

      Just a helpful hint to save you some time...

      It hits random keys (and a small subset more randomly) with INCR. Then it has a view that sorts by the INCR value. It queries with descending=true and you'll eventually get duplicate rows. This took about 2 minutes to kick in on my machine, but it could take longer.

      You'll know the bug is manifest when the printout reads a number less than 100 (it counts the number of distinct docids in a result set with limit=100)

      Attachments

        1. viewbug.zip
          1 kB
        2. debug.json
          11 kB
        3. test.js
          3 kB
        4. test.js
          2 kB
        5. test.js
          2 kB
        For Gerrit Dashboard: MB-8357
        # Subject Branch Project Status CR V

        Activity

          People

            maria Maria McDuff (Inactive)
            jchrisa J Chris Anderson [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                PagerDuty