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

Add PartitionReader.WaitReadConsistencyUntilOffset() #8809

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

pracucci
Copy link
Collaborator

What this PR does

This is another preliminary to ease the review of #8808. In this PR I'm adding PartitionReader.WaitReadConsistencyUntilOffset() which is like WaitReadConsistencyUntilLastProducedOffset() but allows to specify the offset to wait for.

Note to reviewers:

  • I recommend to review changes with "hide whitespace changes"

Which issue(s) this PR fixes or relates to

N/A

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci marked this pull request as ready for review July 24, 2024 10:36
@pracucci pracucci requested a review from a team as a code owner July 24, 2024 10:36
Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

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

LGTM, only a comment about the tests

@@ -172,165 +172,217 @@ func TestPartitionReader_WaitReadConsistency(t *testing.T) {
t.Run("should return after all produced records have been consumed", func(t *testing.T) {
t.Parallel()

consumedRecords := atomic.NewInt64(0)
for _, withOffset := range []bool{false, true} {
t.Run(fmt.Sprintf("with offset %v", withOffset), func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

these tests should be Parallel() too, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

same applies to the other tests in the file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep good point, will do, thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in 75edef3

…roducedOffset_And_WaitReadConsistencyUntilOffset()

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci merged commit 1cc72d5 into main Jul 24, 2024
29 checks passed
@pracucci pracucci deleted the add-WaitReadConsistencyUntilOffset branch July 24, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants