Skip to content
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

KAFKA-16556: SubscriptionState should not prematurely reset 'pending' partitions #15724

Conversation

kirktrue
Copy link
Contributor

@kirktrue kirktrue commented Apr 16, 2024

Partitions that are marked as pendingOnAssignedCallback should not be reset in resetInitializingPositions(). Pending partitions are omitted from the set returned by initializingPartitions(). As a result, the Consumer does not include them in the set of partitions for which it attempts to load committed offsets. The code used by the Consumer to reset positions (resetInitializingPositions()) should likewise skip partitions marked as pending.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

… partitions

Partitions that are marked as pendingOnAssignedCallback should not be reset in resetInitializingPositions. Pending partitions are omitted from the set returned by initializingPartitions(). As a result, the Consumer does not include them in the set of partitions for which it attempts to load committed offsets. The code used by the Consumer to reset positions should likewise omit them from the set of partitions to reset.
@kirktrue
Copy link
Contributor Author

@lucasbru—please kindly take a look at this issue that's occasionally causing consumers to ignore committed offsets. The result is the consumer resets the partition's position back to 0, causing reprocessing of messages.

cc @lianetm @philipnee

Copy link
Member

@lucasbru lucasbru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@lucasbru lucasbru merged commit ebeef4e into apache:trunk Apr 16, 2024
1 check was pending
@kirktrue kirktrue deleted the KAFKA-16556-skip-position-reset-for-pending-partitions branch April 16, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants