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

GH-2731: fix count and time ack mode #2858

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

Wzy19930507
Copy link
Contributor

fixes #2731

Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

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

Thanks.

Duration.ofSeconds(42));
verify(consumer).commitSync(Collections.singletonMap(topicPartition, new OffsetAndMetadata(7L)),
verify(consumer).commitSync(Collections.singletonMap(topicPartition, new OffsetAndMetadata(6L)),
Copy link
Contributor

@garyrussell garyrussell Oct 25, 2023

Choose a reason for hiding this comment

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

Thanks for the contribution; in general it looks good but, in this case, the 7th record's offset will never be committed; I believe we need to accelerate the commit based on count if the next poll returns no records.

Restoring the

		verify(consumer).commitSync(Collections.singletonMap(topicPartition, new OffsetAndMetadata(7L)),
				Duration.ofSeconds(42));

(after the test for offset 6) causes the test to fail.

We also need to adjust the comments on lines 3063, 3068.

count ack mode commit offset when next poll return no records
@garyrussell garyrussell merged commit 7dc8fe1 into spring-projects:main Oct 30, 2023
2 checks passed
@garyrussell garyrussell added this to the 3.1.0 milestone Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AckCount is invalid when ackMode is Count and ackCount is less than maxPollRecords
2 participants