-
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
sql: pre-split hash sharded indexes ranges before DELETE_AND_WRITE_ONLY #74923
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 |
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.
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.
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! 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