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

rangefeed: unconditionally use rangefeed scheduler #114410

Merged
merged 4 commits into from
Jan 3, 2024

Conversation

erikgrinaker
Copy link
Contributor

kvserver: enable rangefeed scheduler by default

Touches #113029.
Epic: none
Release note (performance improvement): rangefeeds, the infrastructure used for changefeeds, now use a more efficient engine that reduces the number of goroutines and the associated Go scheduler pressure and latency.

rangefeed: unconditionally use rangefeed scheduler

This patch unconditionally uses the new rangefeed scheduler. This has no mixed-version concerns, since the scheduler is internal to each node and uses the same client protocol.

Epic: none
Release note (ops change): the setting kv.rangefeed.scheduler.enabled has been removed, as the rangefeed scheduler is now unconditionally enabled.

rangefeed: remove LegacyProcessor

The rangefeed scheduler is now used unconditionally.

rangefeed: remove Config.PushTxnsInterval

This has no effect for scheduler-based processors, which is now the only processor type. Instead, the RangeFeedPushTxnsInterval testing knob is now propagated to the store's rangefeed txn pusher loop.

@erikgrinaker erikgrinaker self-assigned this Nov 14, 2023
@erikgrinaker erikgrinaker requested a review from a team as a code owner November 14, 2023 11:22
@erikgrinaker erikgrinaker requested a review from a team November 14, 2023 11:22
@erikgrinaker erikgrinaker requested a review from a team as a code owner November 14, 2023 11:22
@erikgrinaker erikgrinaker requested review from herkolategan and DarrylWong and removed request for a team November 14, 2023 11:22
Copy link

blathers-crl bot commented Nov 14, 2023

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 12 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker)


pkg/kv/kvserver/rangefeed/processor_test.go line 333 at r2 (raw file):

	sch := NewScheduler(SchedulerConfig{
		Workers:         1,

do we have tests that spin use multiple workers?
Does it make sense to just throw some metamorphic constant here and for the priority workers below?

@miretskiy
Copy link
Contributor

@erikgrinaker -- what's left for this PR? (other than CI)?
You might need to change mixed_version_cdc.go

@erikgrinaker
Copy link
Contributor Author

Nothing really, just wanted to wait for 23.2 to firm up a bit first, to make it easier to backport fixes.

I'll address your comments and merge this when I have time.

@erikgrinaker erikgrinaker requested a review from miretskiy January 2, 2024 16:23
@erikgrinaker erikgrinaker force-pushed the rangefeed-scheduler-default branch from 7e8809b to 2cfd5f9 Compare January 2, 2024 16:23
Copy link
Contributor Author

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

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

You might need to change mixed_version_cdc.go

Thanks, done.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker and @miretskiy)


pkg/kv/kvserver/rangefeed/processor_test.go line 333 at r2 (raw file):

Previously, miretskiy (Yevgeniy Miretskiy) wrote…

do we have tests that spin use multiple workers?
Does it make sense to just throw some metamorphic constant here and for the priority workers below?

It won't make any difference here. There's only a single range, which can only be processed by a single worker at a time by definition. Multiple workers are only relevant with multiple ranges, and these are covered by integration and end-to-end tests.

@erikgrinaker erikgrinaker force-pushed the rangefeed-scheduler-default branch 2 times, most recently from 5efb944 to 941af2e Compare January 2, 2024 17:25
Epic: none
Release note (performance improvement): rangefeeds, the infrastructure
used for changefeeds, now use a more efficient engine that reduces the
number of goroutines and the associated Go scheduler pressure and
latency.
@erikgrinaker erikgrinaker force-pushed the rangefeed-scheduler-default branch from 941af2e to 4075e88 Compare January 3, 2024 09:12
This patch unconditionally uses the new rangefeed scheduler. This has no
mixed-version concerns, since the scheduler is internal to each node and
uses the same client protocol.

Epic: none
Release note (ops change): the setting `kv.rangefeed.scheduler.enabled`
has been removed, as the rangefeed scheduler is now unconditionally
enabled.
The rangefeed scheduler is now used unconditionally.

Epic: none
Release note: None
This has no effect for scheduler-based processors, which is now the only
processor type. Instead, the `RangeFeedPushTxnsInterval` testing knob is
now propagated to the store's rangefeed txn pusher loop.

Epic: none
Release note: None
@erikgrinaker erikgrinaker force-pushed the rangefeed-scheduler-default branch from 4075e88 to 9e97770 Compare January 3, 2024 09:50
@erikgrinaker
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 3, 2024

Build succeeded:

@craig craig bot merged commit d62272f into cockroachdb:master Jan 3, 2024
7 of 9 checks passed
craig bot pushed a commit that referenced this pull request Mar 27, 2024
121138: storage,ingest: enable ingestion optimization using flushableIngest r=aadityasondhi a=aadityasondhi

In cockroachdb/pebble#3398, we introduced an optimization in pebble where we could use flushableIngests with excises for ingesting SSTs with RangeDels and RangeKeyDels.

This patch turns this optimization on using
`sstContainsExciseTombstone`.

Informs cockroachdb/pebble#3335.

Release note: None

121164: Revert "rangefeed: unconditionally use rangefeed scheduler" r=erikgrinaker a=erikgrinaker

This reverts 3/4 commits from #114410, only leaving 1dbdbe9 which enabled the scheduler by default.

There was significant code drift in tests, but I think I've been able to address the conflicts.

This revert does not integrate with the changes from #120347, so the legacy rangefeed processor will not use the improved memory accounting. We still shouldn't leak budget allocations, since the processor implementations are entirely independent, but it's worth having a second look to make sure the registry (which is used by both processors) don't make assumptions about this.

Touches #121054.
Epic: none.
Release note: the following release note from #114410 should be reverted/ignored: "the setting kv.rangefeed.scheduler.enabled has been removed, as the rangefeed scheduler is now unconditionally enabled".

121212: security: wrap error when parsing DN r=rafiss a=rafiss

Epic: CRDB-34126
Release note: None

Co-authored-by: Aaditya Sondhi <[email protected]>
Co-authored-by: Erik Grinaker <[email protected]>
Co-authored-by: Rafi Shamim <[email protected]>
stevendanna added a commit to stevendanna/cockroach that referenced this pull request Oct 17, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>
stevendanna added a commit to stevendanna/cockroach that referenced this pull request Oct 21, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>
wenyihu6 pushed a commit to wenyihu6/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>

# Conflicts:
#	pkg/kv/kvserver/rangefeed/BUILD.bazel
#	pkg/kv/kvserver/rangefeed/bench_test.go
#	pkg/kv/kvserver/rangefeed/processor.go
#	pkg/kv/kvserver/rangefeed/processor_helpers_test.go
#	pkg/kv/kvserver/rangefeed/processor_test.go
#	pkg/kv/kvserver/replica_rangefeed.go
wenyihu6 pushed a commit to wenyihu6/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>

# Conflicts:
#	pkg/kv/kvserver/rangefeed/BUILD.bazel
#	pkg/kv/kvserver/rangefeed/bench_test.go
#	pkg/kv/kvserver/rangefeed/processor.go
#	pkg/kv/kvserver/rangefeed/processor_helpers_test.go
#	pkg/kv/kvserver/rangefeed/processor_test.go
#	pkg/kv/kvserver/replica_rangefeed.go
wenyihu6 pushed a commit to wenyihu6/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>

# Conflicts:
#	pkg/kv/kvserver/rangefeed/BUILD.bazel
#	pkg/kv/kvserver/rangefeed/bench_test.go
#	pkg/kv/kvserver/rangefeed/processor.go
#	pkg/kv/kvserver/rangefeed/processor_helpers_test.go
#	pkg/kv/kvserver/rangefeed/processor_test.go
#	pkg/kv/kvserver/replica_rangefeed.go
wenyihu6 pushed a commit to wenyihu6/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>

# Conflicts:
#	pkg/kv/kvserver/rangefeed/BUILD.bazel
#	pkg/kv/kvserver/rangefeed/bench_test.go
#	pkg/kv/kvserver/rangefeed/processor.go
#	pkg/kv/kvserver/rangefeed/processor_helpers_test.go
#	pkg/kv/kvserver/rangefeed/processor_test.go
#	pkg/kv/kvserver/replica_rangefeed.go
stevendanna added a commit to wenyihu6/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>

# Conflicts:
#	pkg/kv/kvserver/rangefeed/BUILD.bazel
#	pkg/kv/kvserver/rangefeed/bench_test.go
#	pkg/kv/kvserver/rangefeed/processor.go
#	pkg/kv/kvserver/rangefeed/processor_helpers_test.go
#	pkg/kv/kvserver/rangefeed/processor_test.go
#	pkg/kv/kvserver/replica_rangefeed.go
stevendanna added a commit to wenyihu6/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>

# Conflicts:
#	pkg/kv/kvserver/rangefeed/BUILD.bazel
#	pkg/kv/kvserver/rangefeed/bench_test.go
#	pkg/kv/kvserver/rangefeed/processor.go
#	pkg/kv/kvserver/rangefeed/processor_helpers_test.go
#	pkg/kv/kvserver/rangefeed/processor_test.go
#	pkg/kv/kvserver/replica_rangefeed.go
wenyihu6 pushed a commit to wenyihu6/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>
stevendanna added a commit to stevendanna/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>
stevendanna added a commit to stevendanna/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>
stevendanna added a commit to stevendanna/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>
stevendanna added a commit to stevendanna/cockroach that referenced this pull request Oct 23, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>
wenyihu6 pushed a commit to wenyihu6/cockroach that referenced this pull request Oct 24, 2024
The ScheduledProcessor has been in default use since 24.1,
substantially out performs the LegacyProcessor, and is the likely
place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster
setting.

This is similar to cockroachdb#114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled
has been retired. The rangefeed scheduler is now unconditionally
enabled.

Co-authored-by: Erik Grinaker <[email protected]>
craig bot pushed a commit that referenced this pull request Oct 24, 2024
132825: rangefeed: remove LegacyProcessor r=wenyihu6 a=stevendanna

The ScheduledProcessor has been in default use since 24.1, substantially out performs the LegacyProcessor, and is the likely place that new improvements will be implemented.

Here, we remove the LegacyProcessor, retiring the associated cluster setting.

This is similar to #114410, but reconstructed from scratch.

Epic: none

Release note (ops change): The setting kv.rangefeed.scheduler.enabled has been retired. The rangefeed scheduler is now unconditionally enabled.

Co-authored-by: Steven Danna <[email protected]>
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.

3 participants