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


##########
metadata/src/main/java/org/apache/kafka/metadata/storage/Formatter.java:
##########
@@ -432,11 +449,10 @@ 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()) {

Review Comment:
   Maybe we should change this check to `isMetadataDirectory`. We should still 
write a `0-0.checkpoint` for static quorums too. Basically:
   ```
   boolean isMetadataDirectory() {
       return this != LOG_DIRECTORY;
   }



##########
metadata/src/main/java/org/apache/kafka/metadata/storage/Formatter.java:
##########
@@ -432,11 +449,10 @@ 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()) {

Review Comment:
   Maybe we should change this check to `isMetadataDirectory`. We should still 
write a `0-0.checkpoint` for static quorums. Basically:
   ```
   boolean isMetadataDirectory() {
       return this != LOG_DIRECTORY;
   }



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