chia7712 commented on code in PR #22319:
URL: https://github.com/apache/kafka/pull/22319#discussion_r4490626035


##########
core/src/main/scala/kafka/server/KafkaRaftServer.scala:
##########
@@ -55,6 +55,8 @@ class KafkaRaftServer(
   private val (metaPropsEnsemble, bootstrapMetadata) =
     KafkaRaftServer.initializeLogDirs(config, this.logger.underlying, 
this.logIdent)
 
+  info(s"Loaded cluster id ${metaPropsEnsemble.clusterId().get()} from 
meta.properties")

Review Comment:
   Maybe we could add a richer log to `hasValidClusterId`, which is called on 
the receiving side. It allows operators to observe both cluster IDs in a single 
log file.
   
   ```java
       private boolean hasValidClusterId(String requestClusterId) {
           // We don't enforce the cluster id if it is not provided.
           if (requestClusterId == null) {
               return true;
           }
           // this one
           if (!clusterId.equals(requestClusterId)) {
               logger.warn("Rejected {} request: cluster id {} doesn't match 
local cluster id {}",
                       apiKey, requestClusterId, clusterId);
               return false;
           }
           return clusterId.equals(requestClusterId);
       }
   ```



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