cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Ellis (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (CASSANDRA-734) Table.open has a broken lock in it
Date Sun, 24 Jan 2010 19:12:17 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804281#action_12804281
] 

Jonathan Ellis edited comment on CASSANDRA-734 at 1/24/10 7:12 PM:
-------------------------------------------------------------------

> synchronization being slow is mostly a scary story left around from the bad old days
of Java 1.3 and lower

That's true for _uncontested_ syncs but that is not what we have here.  The JVM isn't going
to be able to optimize those away, and it's going to be several orders of magnitude slower
than w/o the sync.

> any thing we build instead of using synchronized will be nearly exactly duplicating synchronized's
behavior except broken and slower

NBHM is lock-free (which actually means it uses lower-level CAS which is much cheaper).

> we should be aiming as much for correctness as we can

I never said otherwise.

> synchronized does a bang up job of fixing this bug now and doing so in a way that is
more performant than other "correct" ways

wrong, see above.

      was (Author: jbellis):
    > synchronization being slow is mostly a scary story left around from the bad old days
of Java 1.3 and lower

That's true for _uncontested_ syncs but that is not what we have here.  The JVM isn't going
to be able to optimize those away, and it's going to be several orders of magnitude slower
than w/o the sync.

> any thing we build instead of using synchronized will be nearly exactly duplicating synchronized's
behavior except broken and slower

NBHM uses lower-level CAS which is much cheaper.

> we should be aiming as much for correctness as we can

I never said otherwise.

> synchronized does a bang up job of fixing this bug now and doing so in a way that is
more performant than other "correct" ways

wrong, see above.
  
> Table.open has a broken lock in it
> ----------------------------------
>
>                 Key: CASSANDRA-734
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-734
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.5
>            Reporter: Jeff Hodges
>            Assignee: Jeff Hodges
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: broken_lock_in_table_open.patch
>
>
> Table.open's lock is used around the Map#put method call but not the #get. This makes
it a source of spurious bugs. The attached patch synchronizes the entire Table.open method
and removes the unused createLock static.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message