andrewchoi5 commented on a change in pull request #8479:
URL: https://github.com/apache/kafka/pull/8479#discussion_r446318540



##########
File path: core/src/main/scala/kafka/cluster/Partition.scala
##########
@@ -499,7 +500,16 @@ class Partition(val topicPartition: TopicPartition,
         addingReplicas = addingReplicas,
         removingReplicas = removingReplicas
       )
-      createLogIfNotExists(partitionState.isNew, isFutureReplica = false, 
highWatermarkCheckpoints)
+      try {
+        this.createLogIfNotExists(partitionState.isNew, isFutureReplica = 
false, highWatermarkCheckpoints)
+      } catch {
+        case e: ZooKeeperClientException =>
+          stateChangeLogger.info(s"A ZooKeeper client exception has occurred 
and makeLeader will be skipping the " +
+            s"state change for the partition with leader epoch: $leaderEpoch 
", e)
+          error(s"ZooKeeper client error occurred while this partition was 
becoming the leader for $topicPartition.", e)

Review comment:
       Makes sense. Would appreciate a review on the change -- @junrao .




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

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


Reply via email to