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
280 stars 85 forks source link

dumpling v5.+ may dump partitioned tables incorrectly because the result of tablesample is inordered #334

Closed lichunzhu closed 2 years ago

lichunzhu commented 3 years ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.

More details see https://github.com/pingcap/tidb/issues/27349

  1. What did you expect to see?

Dumpling dump data correctly.

  1. What did you see instead?

Some data are lost and some are duplicated.

  1. Versions of the cluster

    • Dumpling version (run dumpling -V):

      All v5.0.+, v5.1.+, v5.2.+

    • Source database version (execute SELECT version(); in a MySQL client):

      All v5.0.+, v5.1.+, v5.2.+

lichunzhu commented 3 years ago

We can sort pkVals by ourselves to avoid this problem. https://github.com/pingcap/dumpling/blob/4e012e54ce89fab9551e7ff58ebcffe57590244a/v4/export/dump.go#L726

fubinzh commented 3 years ago

/type bug

fubinzh commented 3 years ago

/severity major

lichunzhu commented 2 years ago

TiDB has already fixed this bug. We'd better ask users to upgrade to newer TiDB to avoid this bug. Close this issue now.