-
Notifications
You must be signed in to change notification settings - Fork 708
Update migrate-large-mysql-to-tidb.md #22106
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
base: master
Are you sure you want to change the base?
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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary of ChangesHello @hfxsd, 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 refines the documentation for migrating large MySQL databases to TiDB, focusing on improving the robustness of the Highlights
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request updates the documentation for migrating large MySQL datasets to TiDB, specifically improving the instructions for running TiDB Lightning in the background. My review focuses on enhancing the clarity and completeness of these instructions to make them more user-friendly, suggesting more explicit steps for creating and executing the recommended script.
| 2. Start the import by running `tidb-lightning`. If you launch the program directly in the command line, the process might exit unexpectedly after receiving a SIGHUP signal. It is not recommended to directly use `nohup` to start a process from the command line. Instead, edit the following script content, for example: | ||
|
|
||
| If you import data from S3, pass the SecretKey and AccessKey that have access to the S3 storage path as environment variables to the TiDB Lightning node. You can also read the credentials from `~/.aws/credentials`. | ||
|
|
||
| {{< copyable "shell-regular" >}} | ||
|
|
||
| ```shell | ||
| #!/bin/bash | ||
| export AWS_ACCESS_KEY_ID=${access_key} | ||
| export AWS_SECRET_ACCESS_KEY=${secret_key} | ||
| nohup tiup tidb-lightning -config tidb-lightning.toml > nohup.out 2>&1 & | ||
| ``` | ||
|
|
||
| Then use the script to start TiDB Lightning. |
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.
The explanation for using a script could be clearer and more instructive. It's good that you're recommending a script over direct nohup usage, but the instructions on how to use the script are a bit vague. Providing a more complete example would be more helpful for users.1
| 2. Start the import by running `tidb-lightning`. If you launch the program directly in the command line, the process might exit unexpectedly after receiving a SIGHUP signal. It is not recommended to directly use `nohup` to start a process from the command line. Instead, edit the following script content, for example: | |
| If you import data from S3, pass the SecretKey and AccessKey that have access to the S3 storage path as environment variables to the TiDB Lightning node. You can also read the credentials from `~/.aws/credentials`. | |
| {{< copyable "shell-regular" >}} | |
| ```shell | |
| #!/bin/bash | |
| export AWS_ACCESS_KEY_ID=${access_key} | |
| export AWS_SECRET_ACCESS_KEY=${secret_key} | |
| nohup tiup tidb-lightning -config tidb-lightning.toml > nohup.out 2>&1 & | |
| ``` | |
| Then use the script to start TiDB Lightning. | |
| 2. Start the import by running `tidb-lightning`. If you launch the program directly in the command line, the process might exit unexpectedly after receiving a SIGHUP signal. To avoid this, it is recommended to save the commands in a script file and then execute it. For example, you can create a script file named `start.sh` with the following content: | |
| If you import data from S3, pass the SecretKey and AccessKey that have access to the S3 storage path as environment variables to the TiDB Lightning node. You can also read the credentials from `~/.aws/credentials`. | |
| ```shell | |
| #!/bin/bash | |
| export AWS_ACCESS_KEY_ID=${access_key} | |
| export AWS_SECRET_ACCESS_KEY=${secret_key} | |
| nohup tiup tidb-lightning -config tidb-lightning.toml > nohup.out 2>&1 & | |
| ``` | |
| Then, make the script executable and run it to start TiDB Lightning: | |
| ```shell | |
| chmod +x start.sh | |
| ./start.sh | |
| ``` |
Style Guide References
Footnotes
-
Instructions should be clear and complete. The suggestion provides a more explicit example of how to create and run the script. ↩
|
LGTM |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?