squah-confluent commented on code in PR #24146:
URL: https://github.com/apache/kafka/pull/24146#discussion_r4532871671


##########
server-common/src/main/java/org/apache/kafka/timeline/Snapshot.java:
##########
@@ -57,6 +57,10 @@ void handleRevert() {
         for (Map.Entry<Revertable, Delta> entry : map.entrySet()) {
             entry.getKey().executeRevert(epoch, entry.getValue());
         }
+        // The current state is now the state at this snapshot, so nothing has 
changed since it
+        // was taken. Drop the deltas so that they are not applied twice and 
so that reads at
+        // this snapshot do not see them on top of the current state.
+        map.clear();

Review Comment:
   Thanks for updating the fix!
   
   Not for this PR: I think it's weird that we don't have tests that exercise 
the snapshotting system in `SnaphotRegistryTest` or `SnapshotTest`. All the 
real coverage is "hidden" in `SnapshottableHashTableTest`.



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

Reply via email to