Details
-
Bug
-
Resolution: Fixed
-
Minor
-
1.7.1
-
Security Level: Public
-
None
-
Ubuntu 10.10 32 bits
Description
Setting values through CAS with a cas_unique of 0 has an unexpected behavior.
It seems possible to set through CAS a non-existing key if you use a cas_unique of 0. This seems different from the implementation of memcached that I compared it against, which wouldn't let you store through CAS if the key didn't exist. Using it this way it is effectively working as an ADD.
This is not a big deal as it is, the real problem is that you can also set it through CAS with a cas_unique of 0 if the key already EXISTS and it has a cas_unique different from 0. I'd expect this to fail, since the cas_unique doesn't match the one in the existing key.
See example, for membase 1.7.1, connected through telnet to port 11211.
flush_all
OK
cas test 0 0 1 0
a
STORED
gets test
VALUE test 0 1 67969
a
END
cas test 0 0 1 0
b
STORED
gets test
VALUE test 0 1 67970
b
END