-
Notifications
You must be signed in to change notification settings - Fork 564
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
ALTER INDEX to change partitioning settings of indexImplTable #4354
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
07617fb
to
e49fbcc
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
e49fbcc
to
872f675
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
872f675
to
505535e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
505535e
to
f0d5467
Compare
⚪
|
⚪
|
&& (!CheckAllowedFields(alter, {"Name", "PartitionConfig"}) | ||
|| (alter.HasPartitionConfig() | ||
&& !CheckAllowedFields(alter.GetPartitionConfig(), {"PartitioningPolicy"}) |
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.
This condition is hard to read and comprehend.
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.
Will try to simplify it in a follow-up PR
auto wellCookedToken = NACLib::TUserToken(TVector<TString>{"not-a-root@builtin"}); | ||
request->Record.SetUserToken(wellCookedToken.SerializeAsString()); |
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.
Why cases with requests with explicit tokens are gone? Check for admin token in alter table is still there.
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.
Yes, the check for superuser is still present in CreateConsistentAlterTable, but the purpose has changed. Currently, every user with AlterScheme permission can alter PartitionConfig.PartitioningPolicy of indexImplTable and superusers can alter any setting of indexImplTable (like they did before).
This particular test, in my opinion, is focused more on the effects of altering PartitionConfig of indexImplTable, then on the permissions of superusers. I think the best solution would be to add another unit test to show the difference between superusers and regular users. In fact, I have already added such a unit test in KQP, but not in SchemeShard.
I will add a similar test in SchemeShard in a follow-up PR.
List of existing tickets on the topic: https://github.com/orgs/ydb-platform/projects/31/views/3?pane=issue&itemId=55226292
Requirements: https://st.yandex-team.ru/KIKIMR-14280
You can read the whole story in the RFC, but the gist of it is provided below.
Previously, there was no available instrument to alter partitioning settings of an index table in spite of the often arising need to do so. It could only be done by superusers (i.e. users listed in AdministrationAllowedSIDs of the cluster; usually just the YDB staff) with either a public API request, or by sending a private SchemeShard's ModifyScheme protobuf. No YQL syntax was available for use even for the superusers (indexImplTable is hidden and cannot be a target of ALTER TABLE request).
We decided to provide users with a way to conveniently alter partitioning settings of an index table. It seems that the most needed options is to set AUTO_PARTITIONING_MIN_PARTITIONS_COUNT to a higher value to prepare for the future load on the index.
Syntax
table_name
- the name of the table, whose index is to be alteredindex_name
- the name of the index to be altered