cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Yeschenko (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-7359) Optimize locking in PaxosState
Date Fri, 06 Jun 2014 17:42:03 GMT


Aleksey Yeschenko commented on CASSANDRA-7359:

I don't mind replacing Object-s with Lock-s. I am against complicating the code for an unproven
reason, though.

Would simply replacing the Object[] array with Guava's Striped make you happy? (like we have

Nothing wrong with Benedict's patch (most likely), other than we are both pretty sure we don't
need it.

> Optimize locking in PaxosState
> ------------------------------
>                 Key: CASSANDRA-7359
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: sankalp kohli
>            Assignee: Benedict
>            Priority: Minor
>         Attachments: 7359.txt
> 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

View raw message