ijuma commented on a change in pull request #8979:
URL: https://github.com/apache/kafka/pull/8979#discussion_r453974679



##########
File path: core/src/main/scala/kafka/server/DelayedFetch.scala
##########
@@ -121,8 +120,8 @@ class DelayedFetch(delayMs: Long,
             }
           }
         } catch {
-          case _: NotLeaderForPartitionException =>  // Case A
-            debug(s"Broker is no longer the leader of $topicPartition, satisfy 
$fetchMetadata immediately")
+          case _: NotLeaderOrFollowerException =>  // Case A
+            debug(s"Broker is no longer the leader or follower of 
$topicPartition, satisfy $fetchMetadata immediately")
             return forceComplete()
           case _: ReplicaNotAvailableException =>  // Case B

Review comment:
       Can we remove this now?

##########
File path: core/src/main/scala/kafka/server/ReplicaManager.scala
##########
@@ -716,8 +712,12 @@ class ReplicaManager(val config: KafkaConfig,
                   _: LogDirNotFoundException |
                   _: ReplicaNotAvailableException |
                   _: KafkaStorageException) =>
-            warn("Unable to alter log dirs for %s".format(topicPartition), e)
+            warn(s"Unable to alter log dirs for $topicPartition", e)
             (topicPartition, Errors.forException(e))
+          case e: NotLeaderOrFollowerException =>
+            // Retaining REPLICA_NOT_AVAILABLE exception for 
ALTER_REPLICA_LOG_DIRS for compatibility
+            warn(s"Unable to alter log dirs for $topicPartition", e)
+            (topicPartition, Errors.REPLICA_NOT_AVAILABLE)

Review comment:
       Would we want to change this for new IBPs?




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