cmccabe commented on code in PR #14628:
URL: https://github.com/apache/kafka/pull/14628#discussion_r1386983421


##########
core/src/main/scala/kafka/server/KafkaServer.scala:
##########
@@ -270,10 +271,31 @@ class KafkaServer(
 
         logDirFailureChannel = new LogDirFailureChannel(config.logDirs.size)
 
+        // Make sure all storage directories have meta.properties files.
+        val metaPropsEnsemble = {
+          val copier = new 
MetaPropertiesEnsemble.Copier(initialMetaPropsEnsemble)
+          
initialMetaPropsEnsemble.nonFailedDirectoryProps().forEachRemaining(e => {
+            val logDir = e.getKey
+            val builder = new MetaProperties.Builder(e.getValue).
+              setClusterId(_clusterId).
+              setNodeId(config.brokerId)
+            if (!builder.directoryId().isPresent()) {
+              builder.setDirectoryId(copier.generateValidDirectoryId())
+            }
+            copier.setLogDirProps(logDir, builder.build())
+          })
+          copier.emptyLogDirs().clear()
+          copier.writeLogDirChanges((logDir, e) => {

Review Comment:
   I added a boolean that indicates the director should be created if it 
doesn't exist.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to