niket-goel commented on a change in pull request #10899: URL: https://github.com/apache/kafka/pull/10899#discussion_r655546225
########## File path: raft/src/main/java/org/apache/kafka/snapshot/SnapshotWriter.java ########## @@ -135,9 +210,12 @@ public void append(List<T> records) { /** * Freezes the snapshot by flushing all pending writes and marking it as immutable. + * + * Also adds a {@link MetadataSnapshotFooterRecord} to the end of the snapshot */ public void freeze() { appendBatches(accumulator.drain()); + finalizeSnapshotWithFooter(); Review comment: Would we not want to drain the pipe (here accumulator) before finalizing it (by stamping the footer). I guess your point is that the footer is yet another record which we can append and then just do one final drain? PS right now in the code the finalize method is also forcing a drain on the accumulator. We could remove that too then. Let me do it that way. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org