dm: add LOCK TABLES privilege note for managed MySQL sources (8.5)#22606
dm: add LOCK TABLES privilege note for managed MySQL sources (8.5)#22606alastori wants to merge 2 commits intopingcap:release-8.5from
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the documentation for TiDB Data Migration (DM) by providing crucial information regarding MySQL user privileges, specifically the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds documentation about the LOCK TABLES privilege requirement for managed MySQL sources like RDS and Aurora when using DM. The changes are applied to the precheck, worker introduction, and quick start guides. My review focuses on improving the clarity and style of the new documentation notes, suggesting minor rephrasing to use active voice and avoid abbreviations, in line with the repository's technical writing style guide.
dm/dm-precheck.md
Outdated
| - SELECT permission on INFORMATION_SCHEMA and dump tables | ||
| - RELOAD permission if `consistency=flush` | ||
| - LOCK TABLES permission on the dump tables if `consistency=flush/lock` | ||
| - LOCK TABLES permission on the dump tables if `consistency=lock`, or if `consistency=auto` and the source is a managed MySQL service (such as Amazon RDS or Aurora) where `FLUSH TABLES WITH READ LOCK` is restricted |
There was a problem hiding this comment.
To improve readability and adhere to the active voice preference in the style guide, I suggest a minor wording change.
| - LOCK TABLES permission on the dump tables if `consistency=lock`, or if `consistency=auto` and the source is a managed MySQL service (such as Amazon RDS or Aurora) where `FLUSH TABLES WITH READ LOCK` is restricted | |
| - LOCK TABLES permission on the dump tables if `consistency=lock`, or if `consistency=auto` and the source is a managed MySQL service (such as Amazon RDS or Aurora) that restricts `FLUSH TABLES WITH READ LOCK` |
References
- The style guide recommends using active voice for clarity (lines 43-45). Changing 'where ... is restricted' to 'that restricts' improves readability. (link)
dm/dm-worker-intro.md
Outdated
| | `REPLICATION SLAVE` | Global | | ||
| | `REPLICATION CLIENT` | Global | | ||
|
|
||
| > **Note:** If migrating from a managed MySQL service (such as Amazon RDS or Aurora) where `FLUSH TABLES WITH READ LOCK` is restricted, the user also needs the `LOCK TABLES` privilege. DM's default `consistency=auto` mode falls back to `LOCK TABLES` for data consistency when FTWRL is unavailable. |
There was a problem hiding this comment.
To improve clarity and better align with the style guide, I suggest rephrasing this note. The proposed changes use active voice, address the user with 'you', and avoid an undefined abbreviation, making the note easier to understand.
| > **Note:** If migrating from a managed MySQL service (such as Amazon RDS or Aurora) where `FLUSH TABLES WITH READ LOCK` is restricted, the user also needs the `LOCK TABLES` privilege. DM's default `consistency=auto` mode falls back to `LOCK TABLES` for data consistency when FTWRL is unavailable. | |
| > **Note:** If you are migrating from a managed MySQL service (such as Amazon RDS or Aurora) that restricts `FLUSH TABLES WITH READ LOCK`, the database user also needs the `LOCK TABLES` privilege. This is because DM's default `consistency=auto` mode falls back to using `LOCK TABLES` for data consistency when `FLUSH TABLES WITH READ LOCK` is unavailable. |
References
- The style guide recommends writing in the second person ('you') (line 22), using active voice (lines 43-45), and ensuring clarity for the user (line 14). The suggested change addresses these points and also avoids an undefined abbreviation. (link)
When migrating from managed MySQL services (RDS, Aurora) where FTWRL is restricted, DM's consistency=auto mode falls back to LOCK TABLES. Added conditional privilege documentation to dm-worker-intro, dm-precheck, and quick-start-with-dm. Confirmed with Minghao Guo: FTWRL→LOCK TABLES fallback is by design, Cloud DM defaults to consistency=auto. Lab evidence: https://github.com/alastori/tidb-sandbox/tree/main/labs/dm/lab-06-lock-tables-privilege Related: pingcap#22598 (Cloud DM docs) Related: https://tidb.atlassian.net/browse/DM-12687 (pre-check improvement)
a2f525c to
cd4fb2b
Compare
Cherry-pick of #22605 to release-8.5.
Adds conditional
LOCK TABLESprivilege documentation for managed MySQL sources (RDS, Aurora) to dm-precheck, dm-worker-intro, and quick-start-with-dm.See #22605 for full context.
Which TiDB version(s) do your changes apply to?
cc @GMHDBJD @qiancai