pingcap / dumpling

Dumpling is a fast, easy-to-use tool written by Go for dumping data from the database(MySQL, TiDB...) to local/cloud(S3, GCP...) in multifarious formats(SQL, CSV...).
Apache License 2.0
281 stars 85 forks source link

hotfix: set sortByPK to false and add backoff retry time. #293

Closed 3pointer closed 3 years ago

3pointer commented 3 years ago

What problem does this PR solve?

What is changed and how it works?

Check List

Tests

Side effects

Related changes

Release note

ti-chi-bot commented 3 years ago

[REVIEW NOTIFICATION]

This pull request has not been approved.

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.

Reviewer can indicate their review by submitting an approval review. Reviewer can cancel approval by submitting a request changes review.
ti-chi-bot commented 3 years ago

@3pointer: This cherry pick PR is for a release branch and has not yet been approved by release team. Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick, it must first be approved by the collaborators.

AFTER it has been approved by collaborators, please ping the release team in a comment to request a cherry pick review.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


3poitner seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

lichunzhu commented 3 years ago

SortByPK won't sort the data in memory. Here is the plan:

mysql> explain select a from t1 order by a;
+--------------------+------------+------+----------------------------------------------+
| id                 | count      | task | operator info                                |
+--------------------+------------+------+----------------------------------------------+
| TableReader_11     | 8480000.00 | root | data:TableScan_10                            |
| └─TableScan_10     | 8480000.00 | cop  | table:t1, range:[-inf,+inf], keep order:true |
+--------------------+------------+------+----------------------------------------------+
2 rows in set (0.01 sec)

mysql> explain select b from t1 order by b;
+---------------------+------------+------+-----------------------------------------------+
| id                  | count      | task | operator info                                 |
+---------------------+------------+------+-----------------------------------------------+
| Sort_4              | 8480000.00 | root | test.t1.b:asc                                 |
| └─TableReader_8     | 8480000.00 | root | data:TableScan_7                              |
|   └─TableScan_7     | 8480000.00 | cop  | table:t1, range:[-inf,+inf], keep order:false |
+---------------------+------------+------+-----------------------------------------------+
3 rows in set (0.00 sec)

mysql> explain select * from t3 order by _tidb_rowid;
+----------------------+------------+------+----------------------------------------------+
| id                   | count      | task | operator info                                |
+----------------------+------------+------+----------------------------------------------+
| Projection_5         | 8000000.00 | root | test.t3.a, test.t3.b, test.t3.c, test.t3.d   |
| └─TableReader_11     | 8000000.00 | root | data:TableScan_10                            |
|   └─TableScan_10     | 8000000.00 | cop  | table:t3, range:[-inf,+inf], keep order:true |
+----------------------+------------+------+----------------------------------------------+
3 rows in set (0.01 sec)

mysql> explain select * from t3;
+-------------------+------------+------+-----------------------------------------------+
| id                | count      | task | operator info                                 |
+-------------------+------------+------+-----------------------------------------------+
| TableReader_5     | 8000000.00 | root | data:TableScan_4                              |
| └─TableScan_4     | 8000000.00 | cop  | table:t3, range:[-inf,+inf], keep order:false |
+-------------------+------------+------+-----------------------------------------------+
2 rows in set (0.00 sec)