ifesdjeen commented on code in PR #3632:
URL: https://github.com/apache/cassandra/pull/3632#discussion_r1816356227


##########
src/java/org/apache/cassandra/tcm/AtomicLongBackedProcessor.java:
##########
@@ -177,17 +177,17 @@ public synchronized EntryHolder getEntries(Epoch since, 
Epoch until)
         public LogState getLogState(Epoch start, Epoch end)
         {
             EntryHolder state = getEntries(Epoch.EMPTY);
-            ClusterMetadata metadata = new 
ClusterMetadata(DatabaseDescriptor.getPartitioner());;
+            ClusterMetadata metadata = new 
ClusterMetadata(DatabaseDescriptor.getPartitioner());
             Iterator<Entry> iter = state.iterator();
             ImmutableList.Builder<Entry> rest = new ImmutableList.Builder<>();
             while (iter.hasNext())
             {
                 Entry current = iter.next();
                 if (current.epoch.isAfter(end))
                     break;
-                if (current.epoch.isEqualOrBefore(start))
+                if (current.epoch.isDirectlyAfter(metadata.epoch))

Review Comment:
   You are right; I have reverted to the previous logic to build snapshot _up 
to_ start epoch; however I have added the invariant now 
`Invariants.checkState(current.epoch.isDirectlyAfter(metadata.epoch));` just to 
make sure.
   
   My logic was that we are executing this in a loop, and we want to apply only 
consecutive epochs. I think previous version of the code only worked because we 
were returning all values as log entries rather than in the snapshot. 
   



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