akhileshchg commented on code in PR #13001:
URL: https://github.com/apache/kafka/pull/13001#discussion_r1052573317


##########
core/src/main/scala/kafka/server/KafkaServer.scala:
##########
@@ -703,8 +703,8 @@ class KafkaServer(
                 case None =>
                   info(s"Broker registration for controller $controllerId is 
not available in the metadata cache")
               }
-            case None =>
-              info("No controller present in the metadata cache")
+            case Some(_: KRaftCachedControllerId) | None =>

Review Comment:
   getControllerId returns Option(CachedControllerId). CachedControllerId has 
two inherited classes: 1) ZkCachedControllerId and 2) KRaftCachedControllerId.
   
   So we need to cover 1) None, 2) Some(KRaftCachedControllerId), and 3) 
Some(ZkCachedControllerId). I'm covering all these conditions. Did I miss 
something, or are you saying we might miss some future inheritance cases?
   
   BTW, I had the below code before. But that seems to have made it confusing 
to the reviewers. Let me know if that works for you @ijuma 
   
   ```
   getControllerId match {
     case Some(controllerId: ZkCachedController) => ...
     case _ => ...
   ```



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