MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException
Reviewers: Mickael Maison Ismael Juma
@@ -736,7 +736,7 @@ class KafkaApis(val requestChannel: RequestChannel,
// If consumer sends FetchRequest V5 or earlier, the client library is not guaranteed to recognize the error code
// for KafkaStorageException. In this case the client library will translate KafkaStorageException to
// UnknownServerException which is not retriable. We can ensure that consumer will update metadata and retry
- // by converting the KafkaStorageException to NotLeaderForPartitionException in the response if FetchRequest version <= 5
+ // by converting the KafkaStorageException to NotLeaderOrFollowerException in the response if FetchRequest version <= 5
if (error == Errors.KAFKA_STORAGE_ERROR && versionId <= 5) {
Errors.NOT_LEADER_OR_FOLLOWER
} else {
@@ -1070,12 +1070,11 @@ class KafkaApis(val requestChannel: RequestChannel,
// NOTE: These exceptions are special cases since these error messages are typically transient or the client
// would have received a clear exception and there is no value in logging the entire stack trace for the same
case e @ (_ : UnknownTopicOrPartitionException |
- _ : NotLeaderForPartitionException |
+ _ : NotLeaderOrFollowerException |
_ : UnknownLeaderEpochException |
_ : FencedLeaderEpochException |
_ : KafkaStorageException |
_ : UnsupportedForMessageFormatException) =>
- e.printStackTrace()
debug(s"Offset request with correlation id $correlationId from client $clientId on " +
s"partition $topicPartition failed due to ${e.getMessage}")
buildErrorResponse(Errors.forException(e), partition)
