-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
variables: add constraints on tidb_super_read_only when tidb_restricted_read_only is turned on #31746
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/a07ce45f6bfd656af950e023b1515949a1180fe6 |
aa0e2d0
to
a17b8e9
Compare
@morgo PTAL again, thanks |
fad6f97
to
68bf1f8
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.
Test Points:
- Privilege
- tidb_super_read_only
- ✅ SUPER and system_variables_admin can toggle this
- ✅ Non-SUPER or Non-system_variables_admin cannot toggle this
- ✅ Any privilege (like USAGE) can see values of tidb_super_read_only
- tidb_restricted_read_only
- If SEM is on
- ✅ restricted_variables_admin can see this variable.
- ✅ restricted_variables_admin+system_variables_admin can toggle this variable.
- ✅ Other privileges can not see this variable.
- ✅ Other privileges can not toggle this variable.
- If SEM is off
- ✅ SUPER and system_variables_admin can see and toggle this.
- ✅ Restricted_system_variable_admin cannot toggle this, can see this.
- ✅ Other privileges can see, but can not toggle this variable.
- If SEM is on
- tidb_super_read_only
- Transmissibility
- ✅ Set tidb_restricted_read_only to ON -> tidb_super_read_only to ON
- ✅ Set tidb_restricted_read_only to OFF -> tidb_super_read_only is unchanged
- ✅ If tidb_restricted_read_only is ON, tidb_super_read_only cannot be set to OFF
- run DDL & DML & LOCK
- If tidb_restricted_read_only is ON or tidb_super_read_only is ON
- ✅RESTRICTED_REPLICA_WRITER_ADMIN can run DDL & DML & LOCK
- ✅ restricted_variables_admin can not run DDL & DML & LOCK.
- ✅ SUPER can not run DDL & DML & LOCK, can run DQL
- ✅ Any others can not run DDL & DML & LOCK
- If tidb_restricted_read_only is ON or tidb_super_read_only is ON
@morgo ptal |
Co-authored-by: Morgan Tocker <[email protected]>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: a07ce45
|
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.2 in PR #31840 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.3 in PR #31841 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.4 in PR #31842 |
What problem does this PR solve?
Issue Number: close #31745
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note