-
Notifications
You must be signed in to change notification settings - Fork 157
refactor: Queue unification #219
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b7b631c
to
7e26075
Compare
7a5b41f
to
88ba43f
Compare
astubbs
added a commit
to astubbs/parallel-consumer
that referenced
this pull request
Mar 22, 2022
…nfluentinc#237) The simplest scenario of this issue, is: using PARTITION ordering max concurrency set to 2 - consumer is able to poll 10 messages, the first 5 for partition 0, the next 5 for partition 1 - when PC requests work from work manager, it first requests 2 work units - work manager then ingests 2 units from it's queue, but to shard partition 0 - then shard iteration begins, partition order restriction is set, so only takes a single entry from the ONLY partition shard of zero - so result is only a single record is returned, even through there are 5 in the queue for the 2nd partition that aren't "realised" - on next request to WM, 1 more unit is requested to hit concurrency target - and this is also ingested from the 3 remaining for partition 0, and the rest for partition 1 are still undiscovered, and so on and so on - extrapolate out... - solution: - ingest the entire work queue into shards every round, which is effectively also what confluentinc#219 Also fixed by upcoming RR: refactor: Queue unification confluentinc#219
88ba43f
to
a8463c9
Compare
a8463c9
to
5f4bacd
Compare
PriorityQueue only provides a sorted `poll`, whereas TreeSet iterates in sorted order.
5f4bacd
to
4eeb008
Compare
astubbs
added a commit
that referenced
this pull request
Apr 7, 2022
The simplest scenario of this issue, is: using PARTITION ordering max concurrency set to 2 - consumer is able to poll 10 messages, the first 5 for partition 0, the next 5 for partition 1 - when PC requests work from work manager, it first requests 2 work units - work manager then ingests 2 units from it's queue, but to shard partition 0 - then shard iteration begins, partition order restriction is set, so only takes a single entry from the ONLY partition shard of zero - so result is only a single record is returned, even through there are 5 in the queue for the 2nd partition that aren't "realised" - on next request to WM, 1 more unit is requested to hit concurrency target - and this is also ingested from the 3 remaining for partition 0, and the rest for partition 1 are still undiscovered, and so on and so on - extrapolate out... - solution: - ingest the entire work queue into shards every round, which is effectively also what #219 Also fixed by upcoming RR: refactor: Queue unification #219
…queue # Conflicts: # parallel-consumer-core/src/test/java/io/confluent/parallelconsumer/truth/TruthGeneratorTests.java
astubbs
commented
Apr 21, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean up all the dead code
...src/main/java/io/confluent/parallelconsumer/internal/AbstractParallelEoSStreamProcessor.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/confluent/parallelconsumer/internal/AbstractParallelEoSStreamProcessor.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/confluent/parallelconsumer/internal/AbstractParallelEoSStreamProcessor.java
Outdated
Show resolved
Hide resolved
...lel-consumer-core/src/main/java/io/confluent/parallelconsumer/internal/BrokerPollSystem.java
Outdated
Show resolved
Hide resolved
...consumer-core/src/main/java/io/confluent/parallelconsumer/internal/CountingCRLinkedList.java
Outdated
Show resolved
Hide resolved
parallel-consumer-core/src/main/java/io/confluent/parallelconsumer/state/WorkManager.java
Outdated
Show resolved
Hide resolved
...ntegration/java/io/confluent/parallelconsumer/integrationTests/LargeVolumeInMemoryTests.java
Outdated
Show resolved
Hide resolved
...gration/java/io/confluent/parallelconsumer/integrationTests/MultiInstanceHighVolumeTest.java
Outdated
Show resolved
Hide resolved
...core/src/test/java/io/confluent/parallelconsumer/offsets/OffsetEncodingBackPressureTest.java
Outdated
Show resolved
Hide resolved
...l-consumer-core/src/test/java/io/confluent/parallelconsumer/offsets/OffsetEncodingTests.java
Outdated
Show resolved
Hide resolved
…och tracking? Also propagates epochs more correctly, due to the queue unification, which enables a proactive epoch check before registering the work.
astubbs
commented
Apr 22, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
3b51ffe
to
aa5c0e1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Massive simplification, much improved semantics around poller notifying of work incoming.
Also address: