-
Notifications
You must be signed in to change notification settings - Fork 14.5k
KAFKA-18486 Update testClearPurgatoryOnBecomingFollower etc with KRaft mechanism in ReplicaManagerTest #19924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3593973
to
bd7d985
Compare
@m1a2st could you please update the title according to the changes? |
@@ -4155,23 +4147,7 @@ class ReplicaManagerTest { | |||
try { | |||
val offsetCheckpoints = new LazyOffsetCheckpoints(replicaManager.highWatermarkCheckpoints.asJava) | |||
replicaManager.createPartition(tp0).createLogIfNotExists(isNew = false, isFutureReplica = false, offsetCheckpoints, None) | |||
val partition0Replicas = Seq[Integer](0, 1).asJava | |||
val topicIds = Map(tp0.topic -> topicId).asJava |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please remove this local variable and use class variable topicIds
instead?
.setTopicId(topicIds.get(topic)) | ||
.setReplicas(brokerList) | ||
.setIsr(brokerList) | ||
.setRemovingReplicas(util.List.of()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a redundant assignment, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m1a2st: I have a couple of minor comments.
.setLeaderEpoch(0) | ||
.setPartitionEpoch(0) | ||
delta.replay(record) | ||
val leaderMetadataImage = imageFromTopics(delta.apply()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we inline this variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay not to inline this variable.
update the following test to avoid using
becomeLeaderOrFollower
Reviewers: TengYao Chi kitingiao@gmail.com, Chia-Ping Tsai
chia7712@gmail.com