You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/07/13 22:20:31 UTC

[GitHub] [kafka] ijuma commented on a change in pull request #8979: KAFKA-10223; Use NOT_LEADER_OR_FOLLOWER instead of non-retriable REPLICA_NOT_AVAILABLE for consumers

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:
users@infra.apache.org