kevin-wu24 commented on code in PR #20707:
URL: https://github.com/apache/kafka/pull/20707#discussion_r2511539025
##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -1022,7 +1020,13 @@ public void
handleLoadSnapshot(SnapshotReader<ApiMessageAndVersion> reader) {
Batch<ApiMessageAndVersion> batch = reader.next();
long offset = batch.lastOffset();
List<ApiMessageAndVersion> messages = batch.records();
-
+ if
(reader.snapshotId().equals(Snapshots.BOOTSTRAP_SNAPSHOT_ID)) {
+ // For bootstrap snapshots, extract feature levels
from all data records
+ if (!messages.isEmpty()) {
+ bootstrapMetadata =
BootstrapMetadata.fromRecords(messages, "bootstrap");
+ return;
+ }
+ }
Review Comment:
Let's add an in-line comment describing what we're doing here for KIP-1170,
since it is not super obvious to the reader.
```suggestion
// KIP-1170: The 0-0.checkpoint can contain metadata records. If it does,
they should be considered the bootstrap metadata for the cluster.
```
--
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]