cmccabe commented on code in PR #13643:
URL: https://github.com/apache/kafka/pull/13643#discussion_r1273720728
##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -2394,6 +2394,11 @@ public Optional<OffsetAndEpoch> latestSnapshotId() {
return log.latestSnapshotId();
}
+ @Override
+ public long logEndOffset() {
+ return log.endOffset().offset;
+ }
Review Comment:
> This is not correct in all cases. The leader can have records in the base
accumulator that have not been sent to the log.
Hmm... the method name is "logEndOffset." So it should just return the log
end offset, right? Returning something else would be misleading.
In any case, we only need this method when the leader becomes active. We
will not use it after that.
##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -2394,6 +2394,11 @@ public Optional<OffsetAndEpoch> latestSnapshotId() {
return log.latestSnapshotId();
}
+ @Override
+ public long logEndOffset() {
+ return log.endOffset().offset;
+ }
Review Comment:
> Can we also add tests for this new functionality?
Yes, good point. I will add a test for the `requiredEndOffset` parameter and
the `logEndOffset` method.
--
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]