dcapwell commented on PR #4167:
URL: https://github.com/apache/cassandra/pull/4167#issuecomment-2895212901

   > shouldn't expect a very high amount of contention here,
   
   Writes are required to be in the `Stage.GOSSIP` other than the 
`EndpointState` for "this" instance, and that one uses the `taskLock` to block 
concurrent mutations... Personally feels like the CAS logic isn't required, but 
I really didn't want to change that type of behavior in this patch; there is 
always something unknown in gossip, so didn't want to poke a bear.
   
   >  I suppose there is some risk of a livelock but I assume you've run this 
through the gossip simulator that would have found any issues.
   
   The locking patch wasn't run through simulation as it doesn't really help.  
Simulation runs several gossip instances on the same thread, so a lock in one 
code path would also be locked when entering another; so its not a good test to 
test locking issues.
   
   I did confirm in simulation that blocking access to the hb/state while its 
being mutated is enough to fix the issue.  But given the way the simulation was 
done this was implemented by doing the following
   
   * when update hb, add a 30% chance to tell the simulation to "fake" 
blocking, and run other background work
   
   This was enough to hit this issue in the tests, and both locks and immutable 
view solve this by not making it possible to read incorrectly.  The issue with 
the lock version is its not clear it covers everything and some times methods 
work with "clones" rather than the "global" version, so locks can be dumb some 
times...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to