Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9A12C109C4 for ; Thu, 5 Jun 2014 20:54:04 +0000 (UTC) Received: (qmail 7969 invoked by uid 500); 5 Jun 2014 20:54:04 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 7937 invoked by uid 500); 5 Jun 2014 20:54:04 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 7926 invoked by uid 99); 5 Jun 2014 20:54:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2014 20:54:04 +0000 Date: Thu, 5 Jun 2014 20:54:04 +0000 (UTC) From: "sankalp kohli (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-7359) Optimize locking in PaxosState MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-7359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] sankalp kohli updated CASSANDRA-7359: ------------------------------------- Assignee: Benedict > Optimize locking in PaxosState > ------------------------------ > > Key: CASSANDRA-7359 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7359 > 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 (v6.2#6252)