incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blair Zajac <bl...@orcaware.com>
Subject CAS and long lived locks
Date Sat, 22 Jun 2013 19:09:48 GMT
Looking at the Cassandra 13 keynote [1], slide 56 regarding hinted 
writes causing the lock to be taken even though the client thinks the 
lock attempt failed, which the new CAS support fixes.

I have some database migrations to run on Cassandra, so I still need a 
long lived lock somewhere to prevent two or more migrations running 
concurrently, so CAS doesn't directly solve this problem.

It sounds like I could have a BOOLEAN column named "lock" but use CAS to 
update it from false or NULL value to true and this avoids the problem 
of hinted updates problem.  The finally block would reset it to false or 
NULL.  This would be a simpler implementation than using the wait chain 
algorithm.

Any problems with this?

Blair

[1] http://www.slideshare.net/jbellis/cassandra-summit-2013-keynote
[2] http://media.fightmymonster.com/Shared/docs/Wait%20Chain%20Algorithm.pdf

Mime
View raw message