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


##########
src/java/org/apache/cassandra/service/accord/AccordConfigurationService.java:
##########
@@ -381,7 +388,7 @@ public synchronized void onNodesRemoved(long epoch, 
Topology current, Set<Node.I
     private long[] nonCompletedEpochsBefore(long max)
     {
         LongArrayList notComplete = new LongArrayList();
-        for (long epoch = epochs.minEpoch(); epoch <= max && epoch <= 
epochs.maxEpoch(); epoch++)
+        for (long epoch = epochs.minEpoch(), maxKnown = epochs.maxEpoch(); 
epoch <= max && epoch <= maxKnown; epoch++)

Review Comment:
   I don't think this iteration is safe? `minEpoch` and `maxEpoch` can change 
while the loop is running. I think we need the epoch monitor when we run this 
loop.



-- 
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