hachikuji commented on a change in pull request #10913: URL: https://github.com/apache/kafka/pull/10913#discussion_r657804676
########## File path: raft/src/test/java/org/apache/kafka/raft/RaftClientTestContext.java ########## @@ -1159,18 +1164,20 @@ void readBatch(BatchReader<String> reader) { } @Override - public void handleLeaderChange(LeaderAndEpoch leader) { + public void handleLeaderChange(LeaderAndEpoch leaderAndEpoch) { // We record the next expected offset as the claimed epoch's start - // offset. This is useful to verify that the `handleClaim` callback + // offset. This is useful to verify that the `handleLeaderChange` callback // was not received early. - if (localId.isPresent() && leader.isLeader(localId.getAsInt())) { + if (localId.isPresent() && leaderAndEpoch.isLeader(localId.getAsInt())) { long claimedEpochStartOffset = lastCommitOffset().isPresent() ? lastCommitOffset().getAsLong() + 1 : 0L; - this.currentClaimedEpoch = OptionalInt.of(leader.epoch()); - this.claimedEpochStartOffsets.put(leader.epoch(), claimedEpochStartOffset); + this.currentClaimedEpoch = OptionalInt.of(leaderAndEpoch.epoch()); Review comment: Yes, makes sense. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org