Details
-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
4.0.0
-
Security Level: Public
-
None
-
Untriaged
-
Centos 64-bit
-
Unknown
Description
memcached has a command to retrieve a random document (i.e., a message to memcached with Opcode: 0xB6).
When I have used this command with a single-node cluster on my Mac, it seems to produce random results.
When running against a multi-node on Linux, however, the documents returned are very far from random. For example, I was running against this cluster: http://ec2-52-6-83-21.compute-1.amazonaws.com:8091, which has 4 data nodes.
I have a test program (attached) that attempts to retrieve 10 distinct keys. It keeps track of the keys received thus far, and flags it if it receives a key a second time.
I am using the beer-sample, which has 7303 documents, so there should be an average of 1825 documents per node. When retrieving 10 keys, the probability of retrieving the same key twice should be approx 9/1825 + 8/1825 + 7/1825... = 45/1825, or about a 2% chance.
Indeed, when I run this program against Couchbase on my Mac, I very seldom see a duplicate doc.
If I run against the Linux cluster, however, I see multiple duplicate keys every time! That's not random! And it doesn't matter which kv node I go against.