Details
-
Bug
-
Resolution: Fixed
-
Critical
-
2.0.1
-
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)