You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Benedict (JIRA)" <ji...@apache.org> on 2014/06/05 22:08:02 UTC
[jira] [Commented] (CASSANDRA-7359) Optimize locking in PaxosState
[ https://issues.apache.org/jira/browse/CASSANDRA-7359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14019171#comment-14019171 ]
Benedict commented on CASSANDRA-7359:
-------------------------------------
It's probably a lot easier to either 1) simply expand the bucket range; or 2) use a ConcurrentHashMap and perform putIfAbsent with the exact hash, so that there is no limit to the number of concurrent operations
> Optimize locking in PaxosState
> ------------------------------
>
> Key: CASSANDRA-7359
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7359
> Project: Cassandra
> Issue Type: Improvement
> Reporter: sankalp kohli
> Priority: Minor
>
> In PaxosState, we want to lock on same rows and have created 1024 size array with java Objects in them to be used for locking.
> We should replace these Objects with some Lock so that we can know whether there is contention trying to acquire a lock for different rows.
> We can achieve that by also storing the hash of the row which acquired the lock. This will tell us if this needs to be improved.
> Here is an improvement which I was thinking about.
> Say two rows A and B map to the same 1024 bucket which we have. A get the lock and B has to wait. Here B can check if his hash is different and create a new object and chain it to the other one.
> This looks close to a hashMap with chaining for same key.
> The hard part will be removing the entries no longer being used.
--
This message was sent by Atlassian JIRA
(v6.2#6252)