Skip to content

*: Change dynamic privileges to non-experimental#24914

Merged
ti-chi-bot merged 3 commits into
pingcap:masterfrom
morgo:change-dynamic-privs-to-stable
May 28, 2021
Merged

*: Change dynamic privileges to non-experimental#24914
ti-chi-bot merged 3 commits into
pingcap:masterfrom
morgo:change-dynamic-privs-to-stable

Conversation

@morgo
Copy link
Copy Markdown
Contributor

@morgo morgo commented May 27, 2021

What problem does this PR solve?

Problem Summary:

This PR proposes switch dynamic privileges from experimental to enabled by default.

The rationale being:

  • The test coverage is very good, with unit tests and integration tests.
  • The feature is copied from MySQL, so the spec is well known. The MySQL tests for dynamic privileges also run on it,
  • Some time has elapsed since the feature first merged (although no GA) and bugs have been minimal.
  • The experimental flag only protected GRANT/REVOKE, since it was not technically feasible to protect other usage. But if issues are discovered, GRANT/REVOKE are easy to avoid (the experimental flag does not offer much protection for stability).
  • The feature is documented: Add docs for dynamic privileges docs#5077

What is changed and how it works?

Proposal: https://github.com/pingcap/tidb/blob/master/docs/design/2021-03-09-dynamic-privileges.md

What's Changed:

Switching from experimental to table.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • None

Release note

  • TiDB now supports Dynamic privileges. This feature is based on the feature of the same name in MySQL 8.0.

@morgo morgo requested review from bb7133 and tiancaiamao May 27, 2021 03:20
@morgo morgo requested a review from a team as a code owner May 27, 2021 03:20
@morgo morgo requested review from XuHuaiyu and removed request for a team May 27, 2021 03:20
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 27, 2021
s.EnableDynamicPrivileges = TiDBOptOn(val)
return nil
}},
{Scope: ScopeGlobal | ScopeSession, Name: TiDBEnableDynamicPrivileges, Value: On, Type: TypeBool, Hidden: true},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just changed to hidden for a small amount of time so that the tidb-tests and tipocket tests that try to set this will still work.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to remove it in the future?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not in any release branches, remove it is OK, otherwise if a global variable is released and user use it, it's hard to change without affecting compatibility.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to remove it. If I remove it right now though, the tidb-test and tipocket tests will fail (since they attempt to set it).

I will instead merge this, fix the tests, and then create a small followup PR.

@github-actions github-actions Bot added the sig/execution SIG execution label May 27, 2021
@bb7133
Copy link
Copy Markdown
Member

bb7133 commented May 27, 2021

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 27, 2021
@bb7133
Copy link
Copy Markdown
Member

bb7133 commented May 28, 2021

PTAL @tiancaiamao

@tiancaiamao
Copy link
Copy Markdown
Contributor

/LGTM

@ti-chi-bot
Copy link
Copy Markdown
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bb7133
  • tiancaiamao

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 28, 2021
@morgo
Copy link
Copy Markdown
Contributor Author

morgo commented May 28, 2021

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

@morgo: /merge is only allowed for the committers, you can assign this pull request to the committer in list by filling /assign @committer in the comment to help merge this pull request.

Details

In response to this:

/merge

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@morgo morgo added the sig/sql-infra SIG: SQL Infra label May 28, 2021
@morgo
Copy link
Copy Markdown
Contributor Author

morgo commented May 28, 2021

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: c448423

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 28, 2021
@ti-chi-bot
Copy link
Copy Markdown
Member

@morgo: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@morgo
Copy link
Copy Markdown
Contributor Author

morgo commented May 28, 2021

/run-unit-test

@ti-chi-bot ti-chi-bot merged commit 7f4f5c0 into pingcap:master May 28, 2021
@morgo morgo deleted the change-dynamic-privs-to-stable branch May 28, 2021 15:41
@morgo morgo mentioned this pull request Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sig/execution SIG execution sig/sql-infra SIG: SQL Infra size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants