-
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
release-21.2: sql: pre-split hash sharded indexes ranges before DELETE_AND_WRITE_ONLY #75474
release-21.2: sql: pre-split hash sharded indexes ranges before DELETE_AND_WRITE_ONLY #75474
Conversation
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
9af9ab0
to
5ec4d67
Compare
8d9d90b
to
40a9206
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)
pkg/sql/schema_changer.go, line 1470 at r1 (raw file):
} if sc.execCfg.Codec.ForSystemTenant() {
AdminSplit
is not allowed in multitenant in 21.2 :(
pkg/sql/logictest/testdata/logic_test/hash_sharded_index_presplit, line 2 at r2 (raw file):
# AdminSplit is not allowed in multi-tenant. # LogicTest: !3node-tenant
skipif config
is not supported in 21.2, so had to create a separate test file.
40a9206
to
e887f50
Compare
Fixes cockroachdb#74558 Pre-split ranges on shard boundaries before SchemaChanger move new hash sharded indexes from DELETE_ONLY to DELETE_AND_WRITE_ONLY state. Release note (bug fix): When creating hash sharded index to an existing table, traffic could hit hard on the single range of the index before it is split into more ranges for shards as range size grows. This change make schema changer able to presplit ranges on shard boundaries before the index becomes writable. `sql.hash_sharded_range_pre_split.max` is the cluster setting added so that users can set the upbound of the amount of ranges to have. If the bucket count of the defined index is less than the cluster setting, the bucket count will be the amount of pre-split ranges.
e887f50
to
08504a3
Compare
Backport 1/1 commits from #74923.
/cc @cockroachdb/release
Fixes #74558
Pre-split ranges on shard boundaries before SchemaChanger move
new hash sharded indexes from DELETE_ONLY to DELETE_AND_WRITE_ONLY
state.
Release note (bug fix): None
Release justification: backporting so that existing hash sharded index users would enjoy the performance gain with pre-split ranges.