mumrah commented on a change in pull request #8822:
URL: https://github.com/apache/kafka/pull/8822#discussion_r438242115
##########
File path:
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java
##########
@@ -466,9 +466,9 @@ public synchronized boolean
maybeValidatePositionForCurrentLeader(ApiVersions ap
* Attempt to complete validation with the end offset returned from the
OffsetForLeaderEpoch request.
* @return The diverging offset if truncation was detected and no reset
policy is defined.
Review comment:
Need to update the return javadoc
##########
File path:
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java
##########
@@ -480,6 +480,17 @@ public synchronized boolean
maybeValidatePositionForCurrentLeader(ApiVersions ap
log.debug("Skipping completed validation for partition {}
since the current position {} " +
"no longer matches the position {} when the
request was sent",
tp, currentPosition, requestPosition);
+ } else if (epochEndOffset.hasUndefinedEpochOrOffset()) {
Review comment:
Ok, so before this change, we were raising OffsetOutOfRangeException
regardless of the state of the subscription which meant that a regular
truncation case was being masked as a failed offset validation?
----------------------------------------------------------------
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:
[email protected]