Skip to content

Conversation

astubbs
Copy link
Contributor

@astubbs astubbs commented Mar 8, 2022

Massive simplification, much improved semantics around poller notifying of work incoming.

Also address:

@astubbs astubbs changed the base branch from master to features/batching March 8, 2022 23:30
@astubbs astubbs marked this pull request as draft March 8, 2022 23:31
@astubbs astubbs force-pushed the features/batching branch 6 times, most recently from b7b631c to 7e26075 Compare March 14, 2022 15:26
@astubbs astubbs force-pushed the features/single-queue branch from 7a5b41f to 88ba43f Compare March 14, 2022 21:23
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
@astubbs astubbs force-pushed the features/single-queue branch from 88ba43f to a8463c9 Compare March 25, 2022 18:31
@astubbs astubbs force-pushed the features/single-queue branch from a8463c9 to 5f4bacd Compare April 6, 2022 08:50
@astubbs astubbs changed the base branch from features/batching to master April 6, 2022 08:54
@astubbs astubbs force-pushed the features/single-queue branch from 5f4bacd to 4eeb008 Compare April 6, 2022 08:55
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
Copy link
Contributor Author

@astubbs astubbs left a 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

Copy link
Contributor Author

@astubbs astubbs left a comment

Choose a reason for hiding this comment

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

...

@astubbs astubbs force-pushed the features/single-queue branch 2 times, most recently from 3b51ffe to aa5c0e1 Compare April 22, 2022 11:08
@astubbs astubbs marked this pull request as ready for review April 22, 2022 11:26
@astubbs astubbs merged commit 9a96686 into confluentinc:master Apr 22, 2022
@astubbs astubbs deleted the features/single-queue branch April 22, 2022 11:29
@astubbs astubbs mentioned this pull request Apr 22, 2022
64 tasks
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.

1 participant