sql: pre-split hash sharded indexes ranges before DELETE_AND_WRITE_ONLY#74923
Conversation
417a790 to
5c8055c
Compare
|
need to rebase after pr #74835 is merged |
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.
5c8055c to
1723f7a
Compare
|
pkg/sql/logictest/testdata/logic_test/hash_sharded_index, line 910 at r1 (raw file):
querying |
ajwerner
left a comment
There was a problem hiding this comment.
Reviewed 5 of 6 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)
pkg/sql/schema_changer_test.go, line 7591 at r1 (raw file):
tdb.Exec(t, ` SET experimental_enable_hash_sharded_indexes = on;
this reminds me, we should create an issue to track deprecating this session variable and removing the gates.
chengxiong-ruan
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)
pkg/sql/schema_changer_test.go, line 7591 at r1 (raw file):
Previously, ajwerner wrote…
this reminds me, we should create an issue to track deprecating this session variable and removing the gates.
ha, that is true. created #75442
|
thanks for the review and adding backporting label :) |
|
Build failed (retrying...): |
|
Build succeeded: |
|
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 1723f7a to blathers/backport-release-21.2-74923: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 21.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
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