kevin-wu24 commented on code in PR #20707:
URL: https://github.com/apache/kafka/pull/20707#discussion_r2445204891


##########
metadata/src/main/java/org/apache/kafka/metadata/storage/Formatter.java:
##########
@@ -511,8 +510,9 @@ static void writeDynamicQuorumSnapshot(
                 Snapshots.BOOTSTRAP_SNAPSHOT_ID)).
             setKraftVersion(KRaftVersion.fromFeatureLevel(kraftVersion)).
             setVoterSet(Optional.of(voterSet));
-        try (RecordsSnapshotWriter<ApiMessageAndVersion> writer = 
builder.build(new MetadataRecordSerde())) {
+        try (RecordsSnapshotWriter<ApiMessageAndVersion> writer = 
builder.build(new MetadataRecordSerde(), 
Optional.of(bootstrapMetadata.records()))) {
             writer.freeze();

Review Comment:
   It doesn't matter what order we write them in because KRaft only reads the 
control records, and the metadata module will only read the "data" records. 
When we read the 0-0.checkpoint back into memory, we only deal with either its 
control records or its data records, not both in the same code.



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