You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Colin McCabe (Jira)" <ji...@apache.org> on 2024/08/29 17:30:00 UTC

[jira] [Commented] (KAFKA-15652) Add tests to verify OffsetFetcherUtils.getOffsetResetTimestamp()

    [ https://issues.apache.org/jira/browse/KAFKA-15652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17877812#comment-17877812 ] 

Colin McCabe commented on KAFKA-15652:
--------------------------------------

Changing target fix version to 4.0 since this is not a blocker and we are past code freeze

> Add tests to verify OffsetFetcherUtils.getOffsetResetTimestamp()
> ----------------------------------------------------------------
>
>                 Key: KAFKA-15652
>                 URL: https://issues.apache.org/jira/browse/KAFKA-15652
>             Project: Kafka
>          Issue Type: Test
>          Components: clients, consumer, unit tests
>            Reporter: Kirk True
>            Assignee: Philip Nee
>            Priority: Minor
>              Labels: consumer-threading-refactor, position, unit-tests
>             Fix For: 4.0.0
>
>
> In the {{updateFetchPositions()}} method implementation, both {{KafkaConsumer}} and {{PrototypeAsyncConsumer}} reset positions asynchronously. [~junrao] stated the following in a [recent PR review|https://github.com/apache/kafka/pull/14406#discussion_r1349173413]:
> {quote}There is a subtle difference between transitioning to reset from initializing and transitioning to reset from {{OffsetOutOfRangeException}} during fetch. In the latter, the application thread will call {{{}FetchCollector.handleInitializeErrors(){}}}. If there is no default offset reset policy, an {{OffsetOutOfRangeException}} will be thrown to the application thread during {{{}poll{}}}, which is what we want.
> However, for the former, if there is no default offset reset policy, we simply ignore that partition through {{{}OffsetFetcherUtils.getOffsetResetTimestamp{}}}. It seems in that case, the partition will be forever in the reset state and the application thread won't get the {{{}OffsetOutOfRangeException{}}}.
> {quote}
> I intentionally changed the code so that no exceptions were thrown in {{OffsetFetcherUtils.getOffsetResetTimestamp()}} and would simply return an empty map. When I ran the unit tests and integration tests, there were no failures, strongly suggesting that there is no coverage of this particular edge case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)