MINOR: Improve readability of `tryProcessAlterPartition`
After the subsequent checks are ensuring that
the leader and partition epochs are not less than. So,
make that explicit.
Reviewers: Jason Gustafson
@@ -2343,7 +2343,7 @@ class KafkaController(val config: KafkaConfig,
// this case to give the leader an opportunity to find the new controller.
partitionResponses(tp) = Left(Errors.NOT_CONTROLLER)
None
- } else if (newLeaderAndIsr.leaderEpoch != currentLeaderAndIsr.leaderEpoch) {
+ } else if (newLeaderAndIsr.leaderEpoch < currentLeaderAndIsr.leaderEpoch) {
partitionResponses(tp) = Left(Errors.FENCED_LEADER_EPOCH)
None
} else if (newLeaderAndIsr.equalsAllowStalePartitionEpoch(currentLeaderAndIsr)) {
@@ -2351,7 +2351,7 @@ class KafkaController(val config: KafkaConfig,
// this check must be done before fencing based on partition epoch to maintain idempotency
partitionResponses(tp) = Right(currentLeaderAndIsr)
None
- } else if (newLeaderAndIsr.partitionEpoch != currentLeaderAndIsr.partitionEpoch) {
+ } else if (newLeaderAndIsr.partitionEpoch < currentLeaderAndIsr.partitionEpoch) {
partitionResponses(tp) = Left(Errors.INVALID_UPDATE_VERSION)
None
} else if (newLeaderAndIsr.leaderRecoveryState == LeaderRecoveryState.RECOVERING && newLeaderAndIsr.isr.length > 1) {
