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

sql: increase minimal max_range_size to 64MiB #96725

Merged
merged 1 commit into from Mar 25, 2023

Conversation

shralex
Copy link
Contributor

@shralex shralex commented Feb 7, 2023

We've seen that small range sizes can be detrimental to various components. This PR makes it so users can't lower max_range_size below 64MiB (half of the default min_range_size), instead of 64KiB previously.

Release note: Small ranges have been known to cause problems in various CRDB subsystems. This PR prevents setting max_range_size below COCKROACH_MIN_RANGE_MAX_BYTES, an environment variable which defaults to 64MiB (half of the default minimum range size).

Epic: https://cockroachlabs.atlassian.net/browse/CRDB-24182
Fixes: #96549

@shralex shralex requested review from a team as code owners February 7, 2023 17:38
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

This was quick! Mostly looks good, left some minor comments.

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten and @shralex)


-- commits line 2 at r1:
This isn't touching any kv packages -- it's better prefixed with sql.

Separately, let's reword the title to use imperative form as per our commit guidelines in https://cockroachlabs.atlassian.net/wiki/spaces/CRDB/pages/73072807/Git+Commit+Messages#GitCommitMessages-Committitle. So something s/increasing/increase/g.


-- commits line 7 at r1:
This deserves a release note.


pkg/config/zonepb/zone_test.go line 62 at r1 (raw file):

				RangeMaxBytes: proto.Int64(60 << 20),
			},
			"RangeMaxBytes 62914560 less than minimum allowed",

Instead of replacing this test case, should we just add another one?

@shralex shralex changed the title kv: increasing the minimal max_range_size to 64MiB sql: increase minimal max_range_size to 64MiB Feb 7, 2023
Copy link
Contributor Author

@shralex shralex left a comment

Choose a reason for hiding this comment

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

Thanks!

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


-- commits line 2 at r1:

Previously, arulajmani (Arul Ajmani) wrote…

This isn't touching any kv packages -- it's better prefixed with sql.

Separately, let's reword the title to use imperative form as per our commit guidelines in https://cockroachlabs.atlassian.net/wiki/spaces/CRDB/pages/73072807/Git+Commit+Messages#GitCommitMessages-Committitle. So something s/increasing/increase/g.

Done.


-- commits line 7 at r1:

Previously, arulajmani (Arul Ajmani) wrote…

This deserves a release note.

Done.


pkg/config/zonepb/zone_test.go line 62 at r1 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

Instead of replacing this test case, should we just add another one?

Done.

Copy link
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

:lgtm: once the commit message is amended.

Reviewed 4 of 4 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @nvanbenschoten and @shralex)


-- commits line 2 at r1:

Previously, shralex wrote…

Done.

Thanks! I think you only made these changes to the Github PR comment block, but not the commit message itself. Could we amend the commit message as well?


-- commits line 7 at r1:

Previously, shralex wrote…

Done.

Same comment as above.

@shralex shralex requested a review from a team February 8, 2023 04:06
@shralex shralex requested review from a team as code owners February 8, 2023 04:06
@shralex shralex requested review from msbutler and removed request for a team February 8, 2023 04:06
@shralex shralex force-pushed the range_size_guardrails branch 4 times, most recently from c8cba19 to 938d746 Compare February 10, 2023 01:41
Copy link
Contributor

@adityamaru adityamaru left a comment

Choose a reason for hiding this comment

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

backupccl changes LGTM!

Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

The change here :lgtm:, but I'm moderately concerned that this is going to break scripts of customers who have been running since before the range size was increased to 512 MiB. Do you think it would be worthwhile changing MinRangeMaxBytes to pull from an env var to give those customers (if they exist) some path to upgrade?

Reviewed 1 of 5 files at r1, 4 of 4 files at r2, 12 of 12 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @msbutler and @shralex)


pkg/kv/kvserver/client_replica_backpressure_test.go line 49 at r3 (raw file):

	// that it takes a while to load.
	const (
		rowSize  = 1 << 20   // 16 KiB

1 MiB


pkg/kv/kvserver/client_replica_backpressure_test.go line 50 at r3 (raw file):

	const (
		rowSize  = 1 << 20   // 16 KiB
		dataSize = 512 << 20 // 512 KiB

512 MiB

@shralex shralex force-pushed the range_size_guardrails branch 7 times, most recently from 5b1053b to bd68f6a Compare February 11, 2023 05:48
Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 5 of 5 files at r5, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @msbutler and @shralex)

@shralex shralex force-pushed the range_size_guardrails branch 3 times, most recently from 8a3da9c to 6abd7dd Compare February 23, 2023 06:51
Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

Signing off on due to the schema code-owners. This is a KV thing at this point.

One minor observation is that we'll have a more general framework for bounding this sort of thing via #96692 for individual tenants. That doesn't conflict with this.

We've seen that small range sizes can be detrimental to various
components. This PR makes it so users can't lower max_range_size
below 64MiB (half of the default min_range_size), instead of 64KiB previously.

Release Note: Small ranges have been known to cause problems in various
CRDB subsystems. This PR prevents setting max_range_size below
COCKROACH_MIN_RANGE_MAX_BYTES, an environment variable which defaults
to 64MiB (half of the default minimum range size).

Epic: https://cockroachlabs.atlassian.net/browse/CRDB-24182
Fixes: cockroachdb#96549
@shralex
Copy link
Contributor Author

shralex commented Mar 25, 2023

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 25, 2023

Build succeeded:

@craig craig bot merged commit 86ad731 into cockroachdb:master Mar 25, 2023
2 checks passed
@knz
Copy link
Contributor

knz commented Mar 25, 2023

Do we want this in 23.1?

@shralex
Copy link
Contributor Author

shralex commented Mar 25, 2023

@knz would probably be useful to prevent misconfigurations. But its very late in the release for .0, so perhaps we can consider a backport later ? wdyt ?

@knz
Copy link
Contributor

knz commented Mar 25, 2023

Yes .1 could be fine

@shralex shralex added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Mar 25, 2023
@shralex
Copy link
Contributor Author

shralex commented Mar 25, 2023

blathers backport 23.1

@blathers-crl
Copy link

blathers-crl bot commented Mar 25, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


Backport to branch 23.1 failed. See errors above.


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

shralex added a commit to shralex/cockroach that referenced this pull request Mar 25, 2023
…race

Fixing an omission in cockroachdb#96725
this test sends snapshots and takes many minutes under race. This PR skips
it.

Epic: none
Release note: None
craig bot pushed a commit that referenced this pull request Mar 26, 2023
99579: kvserver: skip TestBackpressureNotAppliedWhenReducingRangeSize under … r=shralex a=shralex

…race

Fixing an omission in #96725. This test sends snapshots and takes many minutes under race. This PR skips it.

Epic: none
Release note: None

Co-authored-by: shralex <shralex@gmail.com>
renatolabs added a commit to renatolabs/cockroach that referenced this pull request Mar 27, 2023
Jepsen attempts to set custom range sizes using values not allowed
under the new validation added in cockroachdb#96725. We disable that validation
by setting the `COCKROACH_MIN_RANGE_MAX_BYTES` environment variable
when invoking Jepsen.

Epic: none

Release note: None
renatolabs added a commit to renatolabs/jepsen that referenced this pull request Mar 27, 2023
Jepsen attempts to set custom range sizes using values not allowed
under the new validation added in [1]. We disable that validation
by setting the COCKROACH_MIN_RANGE_MAX_BYTES environment variable when
startting cockroachdb.

[1] cockroachdb/cockroach#96725
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kv: guardrails for range size
7 participants