CAS is broken

dormando dormando at rydia.net
Mon Nov 12 06:50:42 UTC 2007


Chris Goffinet wrote:
> The mutex part is handled right now using the threads code, every item 
> allocation has a mutex around it, so this should be safe by calling 
> inside the item_allocation.
> 
> Right now every item does have its own cas id. If you propose the 
> following scenario:
> 
> set foo -> id 0
> gets foo -> id 0
> delete foo
> set foo -> id 0
> cas foo -> sent using 0
> 
> That would succeed when it should of failed. The second set should of 
> caused it to be 1.
> 

Think I'll second that the global is probably okay. You'd have to do 
100,000 sets per second for the next 5.8 million years to overflow the 
counter. Unless my math is off of course.

-Dormando


More information about the memcached mailing list