Skip to content

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

Merged
merged 6 commits into from
Jun 11, 2025

Conversation

m1a2st
Copy link
Collaborator

@m1a2st m1a2st commented Jun 8, 2025

update the following test to avoid using becomeLeaderOrFollower

  • testClearPurgatoryOnBecomingFollower
  • testDelayedFetchIncludesAbortedTransactions
  • testDisabledTransactionVerification
  • testFailedBuildRemoteLogAuxStateMetrics

Reviewers: TengYao Chi kitingiao@gmail.com, Chia-Ping Tsai
chia7712@gmail.com

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tests Test fixes (including flaky tests) labels Jun 8, 2025
@m1a2st m1a2st force-pushed the KAFKA-18486-m1a2st branch from 3593973 to bd7d985 Compare June 8, 2025 06:04
@chia7712
Copy link
Member

chia7712 commented Jun 8, 2025

@m1a2st could you please update the title according to the changes?

@m1a2st m1a2st changed the title KAFKA-18486 Remove ReplicaManagerTest#becomeLeaderOrFollower KAFKA-18486 Update testClearPurgatoryOnBecomingFollower, testDelayedFetchIncludesAbortedTransactions Jun 8, 2025
@m1a2st m1a2st changed the title KAFKA-18486 Update testClearPurgatoryOnBecomingFollower, testDelayedFetchIncludesAbortedTransactions KAFKA-18486 Update testClearPurgatoryOnBecomingFollower, testDelayedFetchIncludesAbortedTransactions... wih KRaft mechanism in ReplicaManagerTest Jun 8, 2025
@m1a2st m1a2st changed the title KAFKA-18486 Update testClearPurgatoryOnBecomingFollower, testDelayedFetchIncludesAbortedTransactions... wih KRaft mechanism in ReplicaManagerTest KAFKA-18486 Update testClearPurgatoryOnBecomingFollower, testDelayedFetchIncludesAbortedTransactions... with KRaft mechanism in ReplicaManagerTest Jun 8, 2025
@m1a2st m1a2st changed the title KAFKA-18486 Update testClearPurgatoryOnBecomingFollower, testDelayedFetchIncludesAbortedTransactions... with KRaft mechanism in ReplicaManagerTest KAFKA-18486 Update testClearPurgatoryOnBecomingFollower etc with KRaft mechanism in ReplicaManagerTest Jun 8, 2025
@@ -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
Copy link
Member

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())
Copy link
Member

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?

@github-actions github-actions bot removed the triage PRs from the community label Jun 9, 2025
Copy link
Contributor

@frankvicky frankvicky left a 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())
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

@github-actions github-actions bot added the small Small PRs label Jun 10, 2025
@chia7712 chia7712 merged commit 7c715c0 into apache:trunk Jun 11, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Kafka Broker small Small PRs tests Test fixes (including flaky tests)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants