-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
changefeedccl: parallelize event consumption #87994
Conversation
b7d1592
to
b3337e1
Compare
settings.TenantWritable, | ||
"changefeed.event_consumer_workers", | ||
"the number of workers to use when processing events; 0 disables", | ||
32, |
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.
Seems like the improvement over single-threaded should be pretty evident with 2 workers, maybe let’s do our testing with low numbers to better understand the behavior.
b3337e1
to
0ae9875
Compare
You probably need to drop changefeedccl: disable flushing when oom test under race commit since I believe this issue been fixed on the master. |
2bb5f17
to
3eac519
Compare
3eac519
to
af63bf1
Compare
af63bf1
to
f26f920
Compare
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.
Mostly nits; please remember to drop your top commit.
"changefeed.event_consumer_worker_queue_size", | ||
"if changefeed.event_consumer_workers is enabled, this setting sets the maxmimum number of events"+ | ||
"which a worker can buffer", | ||
16, |
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.
let's make that metamorphic... 0 -> 16?
Also.... 16 was rather arbitrary, no?
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.
It's arbitrary. Making it unbounded is a bit scary. I'll make it metamorphic for 1-16.
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.
Turns out, using 0 for size is great at finding bugs...
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.
Sure. I'll do it. But, I will look forward to setting it to my scientifically chosen value of 16 in the next month or so 😄
47b115c
to
33f3429
Compare
Make `span.Frontier` thread safe by default. Release note: None
33f3429
to
806df28
Compare
79bfe97
to
7af123d
Compare
Previously, KV events were consumed and processed by changefeed aggregator using a single, synchronous Go routine. This PR makes it possible to run up to `changefeed.event_consumer_workers` consumers to consume events concurrently. The cluster setting `changefeed.event_consumer_worker_queue_size` is added to help control the number of concurrent events we can have in flight. Specifying `changefeed.event_consumer_workers=0` keeps existing single threaded implementation. Release note (enterprise change): This change adds the cluster setting `changefeed.event_consumer_workers` which allows changefeeds to process events concurrently.
7af123d
to
81116ae
Compare
bors r+ |
Build failed (retrying...): |
Build succeeded: |
Posting results for reference. 350MB/s -> 700MB/s improvement. Results depend on #88395 |
I’ll release my plug for lower numbers, perhaps even 2, as default to start with. Of course we're eager to have higher throughput of course, but a lower number will help us to observe and debug, and is likely to minimize surprises. Customers can always increase the # on our advice, and we can increase defaults in future releases. |
I don't know... I'd go with 4 or 8; if there are bugs I'd rather see those than try tomake them less likely. |
Fixes: #86902
span: make span.Frontier thread safe
Make
span.Frontier
thread safe by default.Release note: None
changefeedccl: parallelize event consumption
Previously, KV events were consumed and processed by changefeed
aggregator using a single, synchronous Go routine. This PR makes
it possible to run up to
changefeed.event_consumer_workers
consumers to consume events concurrently. The cluster setting
changefeed.event_consumer_worker_queue_size
is added to helpcontrol the number of concurrent events we can have in flight.
Specifying
changefeed.event_consumer_workers=0
keeps existingsingle threaded implementation.
Release note (enterprise change): This change adds the cluster setting
changefeed.event_consumer_workers
which allows changefeeds toprocess events concurrently.