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

Blake Eggleston commented on CASSANDRA-15059:
---------------------------------------------

bq. quarantineEndpoint and replacementQuarantine are private, but maybe check 
there as well? I don't feel strongly about it, but it's slightly safer when 
they are called indirectly.

{{quarantineEndpoint}} (and by extension, {{replacementQuarantine}}) modifies 
the {{justRemovedEndpoints}} map. This map is also modified in the GossipTask 
thread, and is done correctly as far as I can tell. That's why I didn't add the 
assertion there.

bq. assassinateEndpoint asserts on the thread inside the lambda for run in 
Gossip stage. Harmless, but is it too much?

Probably overkill, removed.

bq. notifyFailureDetector seems like it could tolerate having this assertion 
since it is called from VerbHandlers in the gossip stage?

Nothing happens in that method that we'd need to assert the thread for. I could 
see adding an assertion with the interface refactor, but I wouldn't want make 
noise in people's logs if we're not actually doing anything worth complaining 
about.

bq. applyNewStates is also private, but maybe check the assertion there?

Same as above

I also switched to using the NoSpamLogger for the assertion.

> Gossiper#markAlive can race with Gossiper#markDead
> --------------------------------------------------
>
>                 Key: CASSANDRA-15059
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15059
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Cluster/Gossip
>            Reporter: Blake Eggleston
>            Assignee: Blake Eggleston
>            Priority: Normal
>
> The Gossiper class is not threadsafe and assumes all state changes happen in 
> a single thread (the gossip stage). Gossiper#convict, however, can be called 
> from the GossipTasks thread. This creates a race where calls to 
> Gossiper#markAlive and Gossiper#markDead can interleave, corrupting gossip 
> state. Gossiper#assassinateEndpoint has a similar problem, being called from 
> the mbean server thread.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to