belliottsmith commented on code in PR #3664:
URL: https://github.com/apache/cassandra/pull/3664#discussion_r1837212421


##########
src/java/org/apache/cassandra/service/accord/AccordConfigurationService.java:
##########
@@ -614,28 +636,32 @@ public static EpochSnapshot notStarted(long epoch)
     }
 
     @VisibleForTesting
-    public synchronized EpochSnapshot getEpochSnapshot(long epoch)
+    public EpochSnapshot getEpochSnapshot(long epoch)
     {
         if (epoch < epochs.minEpoch() || epoch > epochs.maxEpoch())
             return null;
 
-        return new EpochSnapshot(getOrCreateEpochState(epoch));
+        // lock for read visibility to syncStatus
+        synchronized (this)
+        {
+            return new EpochSnapshot(getOrCreateEpochState(epoch));

Review Comment:
   do we want to hold both locks at once? can't we get the `EpochState` and 
then build `EpochSnapshot`? What visibility are we looking for here, isn't it 
enough to piggy-back on the visibility semantics of the `epoch` monitor?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to