kevin-wu24 commented on code in PR #20707:
URL: https://github.com/apache/kafka/pull/20707#discussion_r2491721079
##########
metadata/src/main/java/org/apache/kafka/metadata/storage/Formatter.java:
##########
@@ -437,14 +436,11 @@ void doFormat(BootstrapMetadata bootstrapMetadata) throws
Exception {
directoryTypes.get(writeLogDir).description(), writeLogDir,
MetadataVersion.FEATURE_NAME, releaseVersion);
Files.createDirectories(Paths.get(writeLogDir));
- BootstrapDirectory bootstrapDirectory = new
BootstrapDirectory(writeLogDir);
- bootstrapDirectory.writeBinaryFile(bootstrapMetadata);
- if
(directoryTypes.get(writeLogDir).isDynamicMetadataDirectory()) {
- writeDynamicQuorumSnapshot(writeLogDir,
- initialControllers.get(),
- featureLevels.get(KRaftVersion.FEATURE_NAME),
- controllerListenerName);
- }
+ writeBoostrapSnapshot(writeLogDir,
+ bootstrapMetadata,
+ initialControllers,
+ featureLevels.get(KRaftVersion.FEATURE_NAME),
+ controllerListenerName);
Review Comment:
It doesn't make sense to write the 0-0.checkpoint on a broker-only node. It
looks like `bootstrap.checkpoint` does get written on brokers, but IMO that is
incorrect.
You can add like a `setRole` method and have an enum to represent the
possible roles for a node.
--
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]