Skip to content

Commit 90087e4

Browse files
KAFKA-19776: Fix log values for leader epoch (#20676)
We missed a branch in #20671. This PR handles the else branch where we log about skipping the follower state change. Also updated the doc for the method as it was out of date. Reviewers: Chia-Ping Tsai <[email protected]>
1 parent 2f260d7 commit 90087e4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/src/main/scala/kafka/cluster/Partition.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,7 @@ class Partition(val topicPartition: TopicPartition,
835835

836836
/**
837837
* Make the local replica the follower by setting the new leader and ISR to empty
838-
* If the leader replica id does not change and the new epoch is equal or one
839-
* greater (that is, no updates have been missed), return false to indicate to the
838+
* If the new leader epoch is less than current, return false to indicate to the
840839
* replica manager that state is already correct and the become-follower steps can
841840
* be skipped.
842841
*/
@@ -882,7 +881,7 @@ class Partition(val topicPartition: TopicPartition,
882881
s"Previous leader $prevLeaderReplicaIdOpt and previous leader epoch was $prevLeaderEpoch.")
883882
} else {
884883
stateChangeLogger.info(s"Skipped the become-follower state change for $topicPartition with topic id $topicId, " +
885-
s"partition registration $partitionRegistration and isNew=$isNew since it is already a follower with leader epoch $leaderEpoch.")
884+
s"partition registration $partitionRegistration and isNew=$isNew since it is already a follower with leader epoch $prevLeaderEpoch.")
886885
}
887886

888887
// We must restart the fetchers when the leader epoch changed regardless of

0 commit comments

Comments
 (0)