jingjia88 commented on code in PR #20014:
URL: https://github.com/apache/kafka/pull/20014#discussion_r2164054705
##########
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala:
##########
@@ -1225,65 +1196,55 @@ class ReplicaManagerTest {
}
}
- @Test
- def testBecomeFollowerWhenLeaderIsUnchangedButMissedLeaderUpdate(): Unit = {
- verifyBecomeFollowerWhenLeaderIsUnchangedButMissedLeaderUpdate(new
Properties, expectTruncation = false)
- }
-
/**
* If a partition becomes a follower and the leader is unchanged it should
check for truncation
* if the epoch has increased by more than one (which suggests it has missed
an update). For
* IBP version 2.7 onwards, we don't require this since we can truncate at
any time based
* on diverging epochs returned in fetch responses.
*/
- private def
verifyBecomeFollowerWhenLeaderIsUnchangedButMissedLeaderUpdate(extraProps:
Properties,
-
expectTruncation: Boolean): Unit = {
- val topicPartition = 0
+ @Test
+ def testBecomeFollowerWhenLeaderIsUnchangedButMissedLeaderUpdate(): Unit = {
+ val extraProps = new Properties
+ val expectTruncation = false
val followerBrokerId = 0
val leaderBrokerId = 1
- val controllerId = 0
- val controllerEpoch = 0
var leaderEpoch = 1
val leaderEpochIncrement = 2
- val aliveBrokerIds = Seq[Integer](followerBrokerId, leaderBrokerId)
val countDownLatch = new CountDownLatch(1)
val offsetFromLeader = 5
-
// Prepare the mocked components for the test
val (replicaManager, mockLogMgr) = prepareReplicaManagerAndLogManager(new
MockTimer(time),
- topicPartition, leaderEpoch + leaderEpochIncrement, followerBrokerId,
leaderBrokerId, countDownLatch,
+ 0, leaderEpoch + leaderEpochIncrement, followerBrokerId, leaderBrokerId,
countDownLatch,
Review Comment:
Thanks for the review. Updated, PTAL~
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]