mumrah commented on code in PR #15744:
URL: https://github.com/apache/kafka/pull/15744#discussion_r1569103206


##########
core/src/main/scala/kafka/zk/KafkaZkClient.scala:
##########
@@ -467,13 +470,33 @@ class KafkaZkClient private[zk] (zooKeeperClient: 
ZooKeeperClient, isSecure: Boo
    * @param rootEntityType entity type
    * @param sanitizedEntityName entity name
    * @throws KeeperException if there is an error while setting or creating 
the znode
+   * @throws ControllerMovedException if no controller is defined, or a KRaft 
controller is defined
    */
   def setOrCreateEntityConfigs(rootEntityType: String, sanitizedEntityName: 
String, config: Properties): Unit = {
+    val controllerRegistration = getControllerRegistration match {
+      case Some(registration) => registration
+      case None =>
+        // This case is mainly here to make tests less flaky. In practice, 
there will always be a /controller ZNode

Review Comment:
   I found that the integration test would fail occasionally because the config 
change would happen before an active controller was seen (so zkVersion was 0). 
Adding this exception allows the test to retry to alter config call.
   
   In production, this could only be hit if someone was actively calling alter 
configs as the cluster was being deployed and the call was handled in between 
the time that the first broker came up and when the controller became active. 



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