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

Blake Eggleston commented on CASSANDRA-14871:
---------------------------------------------

Thanks Joel, set myself as reviewer.

I spent some more time looking at the compaction strategy and TypeParser parts 
of the patch, and have some comments there as well.

[DateTiered/SizeTiered/TimeWindow]CompactionStrategy
 * access to sstables should be synchronized with the same granularity as the 
rest of the strategy state (ie: {{synchronized (this)}}). I don’t see any 
reason why we’d want to synchronize access to the sstable collection separately.

TypeParser
 * Again, if we’re using copy on write for the cache, we should make the cache 
immutable. Also we shouldn’t allocate a new map in the synchronized block 
unless we verify it’s still missing the key we’re interested in.

See previous comment for TokenMetadata

> Severe concurrency issues in STCS,DTCS,TWCS,TMD.Topology,TypeParser
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-14871
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14871
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>            Priority: Critical
>             Fix For: 4.0, 3.0.x, 3.11.x
>
>
> There are a couple of places in the code base that do not respect that 
> j.u.HashMap + related classes are not thread safe and some parts rely on 
> internals of the implementation of HM, which can change.
> We have observed failures like {{NullPointerException}} and  
> {{ConcurrentModificationException}} as well as wrong behavior.
> Affected areas in the code base:
>  * {{SizeTieredCompactionStrategy}}
>  * {{DateTieredCompactionStrategy}}
>  * {{TimeWindowCompactionStrategy}}
>  * {{TokenMetadata.Topology}}
>  * {{TypeParser}}
>  * streaming / concurrent access to {{LifecycleTransaction}} (handled in 
> CASSANDRA-14554)
> While the patches for the compaction strategies + {{TypeParser}} are pretty 
> straight forward, the patch for {{TokenMetadata.Topology}} requires it to be 
> made immutable.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to