Skip to content
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

domain: run FLUSH PRIVILEGES synchronous on GRANT #8886

Merged
merged 2 commits into from
Dec 31, 2018
Merged

domain: run FLUSH PRIVILEGES synchronous on GRANT #8886

merged 2 commits into from
Dec 31, 2018

Conversation

morgo
Copy link
Contributor

@morgo morgo commented Dec 29, 2018

What problem does this PR solve?

Fixes #8427

What is changed and how it works?

When a GRANT, DROP USER, CREATE USER is run, TiDB will asynchronously notify peers via etcd. The problem is that for the test suite, mocktikv (and MySQL compatibility) it is required to run FLUSH PRIVILEGES synchronously. This is because changes are expected to apply immediately.

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Code changes

  • Yes

Side effects

  • Possible performance regression (the server will do more work, since it will re-run FLUSH PRIVILEGES when it receives the etcd notification)
  • Increased code complexity (or actually decreased when you consider test simplification)

Related changes

  • Need to be included in the release note

This change is Reviewable

@morgo
Copy link
Contributor Author

morgo commented Dec 29, 2018

/run-all-tests

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 30, 2018
Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

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

LGTM

@lonng lonng added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 31, 2018
@morgo morgo merged commit 8e4d18a into pingcap:master Dec 31, 2018
@morgo morgo deleted the flush branch December 31, 2018 14:05
yu34po pushed a commit to yu34po/tidb that referenced this pull request Jan 2, 2019
@morgo morgo restored the flush branch January 4, 2019 14:52
@morgo morgo deleted the flush branch January 4, 2019 15:23
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/privilege contribution This PR is from a community contributor. status/LGT2 Indicates that a PR has LGTM 2. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GRANT statements do not invalidate privilege cache
4 participants