cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

changefeedccl: make a changefeed setting for sink IO workers

Open KeithCh opened this issue 1 year ago • 6 comments

We currently have a cluster setting changefeed.sink_io_workers for configuring the number of workers in the parallel IO instance.

We should have a changefeed setting to allow this to be configured on a per-feed basis, and use the min of the two values if they're different.

Jira issue: CRDB-54990

KeithCh avatar Oct 01 '25 18:10 KeithCh

cc @cockroachdb/cdc

blathers-crl avatar Oct 01 '25 18:10 blathers-crl

Hey @KeithCh,

If this is still relevant and not super urgent, I'd like to give this a shot. I haven't contributed to cockroach previously and this issue seems like a nice way to dive into the code.

The approach I have in mind would be to allow setting the option when creating a changefeed e.g.

CREATE CHANGEFEED FOR TABLE ...
WITH num_sink_workers = ...

and making the value available through the StatementOptions.

Finally, the StatementOptions could be passed to the numSinkIOWorkers() function to determine whether to use a specifically set number of workers or the cluster setting.

What do you think?

fabschn avatar Oct 23 '25 19:10 fabschn

Hey @fabschn, Keith is on vacation right now, but yeah feel free to take a look at this one. Your approach sounds good to me.

asg0451 avatar Oct 23 '25 20:10 asg0451

Thanks Miles for getting back to me while Keith is on vacation. I'll dive a bit deeper into it and hope to submit a PR during the upcoming week - or else I'll let you know if I encounter any blockers with the approach above.

fabschn avatar Oct 26 '25 15:10 fabschn

I just opened a PR for this - let me know what you think.

For transparency: since the changes are contained to the changefeedccl package, I only ran the tests for this package ./dev test changefeedccl -v. Additionally, I ran the short version of the linter: ./dev lint --short

Let me know if I should run any additional checks locally before triggering the CI jobs.

fabschn avatar Oct 27 '25 07:10 fabschn

I'd like to work on this

kriyanshii avatar Aug 12 '26 15:08 kriyanshii