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

dumpling: use I_S to get table list for TiDB and add database to WHERE #57894

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Dec 2, 2024

What problem does this PR solve?

Issue Number: close #57902

Problem Summary:

What changed and how does it work?

by copilot

dumpling/export/dump.go: The logic for preparing the table list to dump has been updated to optimize the performance of reading INFORMATION_SCHEMA.TABLES for TiDB. It includes conditional checks and refactored code.
dumpling/export/sql.go: The function ListAllDatabasesTables has been refactored for improved readability and efficiency, particularly when querying INFORMATION_SCHEMA.TABLES. The function CheckIfSeqExists has been renamed to checkIfSeqExists.
dumpling/export/sql_test.go: Corresponding test cases have been updated to reflect the renaming of the function CheckIfSeqExists to checkIfSeqExists.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.
/dumpling-patch -u root -P 4000 -h xxx --filetype csv -t 16 -r 200000 -F 256MiB --database sb10wnormal1 --loglevel debug
[2024/12/02 10:50:39.356 +00:00] [INFO] [versions.go:54] ["Welcome to dumpling"]...
...
[2024/12/02 10:50:41.123 +00:00] [INFO] [main.go:82] ["dump data successfully, dumpling will exit now"]

root@benchtoolset2-0:/# ll export-2024-12-02T10\:50\:39Z/
total 3832
drwxrwxrwx 2 root root    4096 Dec  2 10:50 ./
drwxr-xr-x 1 root root    4096 Dec  2 10:50 ../
-rw-r--r-- 1 root root     150 Dec  2 10:50 metadata
-rw-r--r-- 1 root root     140 Dec  2 10:50 sb10wnormal1-schema-create.sql
-rw-r--r-- 1 root root     391 Dec  2 10:50 sb10wnormal1.sbtest1-schema.sql
-rw-r--r-- 1 root root 1947727 Dec  2 10:50 sb10wnormal1.sbtest1.0000000010000.csv
-rw-r--r-- 1 root root     391 Dec  2 10:50 sb10wnormal1.sbtest2-schema.sql
-rw-r--r-- 1 root root 1947783 Dec  2 10:50 sb10wnormal1.sbtest2.0000000010000.csv

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-triage-completed component/dumpling This is related to Dumpling of TiDB. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 2, 2024
Copy link

tiprow bot commented Dec 2, 2024

Hi @lance6716. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 48.78049% with 21 lines in your changes missing coverage. Please review.

Project coverage is 73.6173%. Comparing base (6434ca4) to head (dcd2167).
Report is 16 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57894        +/-   ##
================================================
+ Coverage   72.8734%   73.6173%   +0.7438%     
================================================
  Files          1677       1687        +10     
  Lines        464634     468565      +3931     
================================================
+ Hits         338595     344945      +6350     
+ Misses       105152     102838      -2314     
+ Partials      20887      20782       -105     
Flag Coverage Δ
integration 43.4353% <ø> (?)
unit 72.5536% <48.7804%> (+0.2786%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.6910% <48.7804%> (-0.0764%) ⬇️
parser ∅ <ø> (∅)
br 45.4752% <ø> (-0.2416%) ⬇️

Signed-off-by: lance6716 <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 2, 2024
@lance6716 lance6716 changed the title [WIP]dumpling: always use I_S.TABLES to get table list dumpling: always use I_S.TABLES to get table list Dec 2, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 2, 2024
Signed-off-by: lance6716 <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 2, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. and removed do-not-merge/needs-triage-completed labels Dec 2, 2024
@lance6716 lance6716 changed the title dumpling: always use I_S.TABLES to get table list dumpling: use I_S to get table list for TiDB and add database to WHERE Dec 3, 2024
Copy link
Collaborator

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Dec 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, tangenta

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 3, 2024
Copy link

ti-chi-bot bot commented Dec 3, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-02 12:24:00.556097739 +0000 UTC m=+1071228.175752254: ☑️ agreed by tangenta.
  • 2024-12-03 06:17:35.278592259 +0000 UTC m=+1135642.898246775: ☑️ agreed by Benjamin2037.

@ti-chi-bot ti-chi-bot bot merged commit 4fbe02a into pingcap:master Dec 3, 2024
29 checks passed
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Dec 3, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #57936.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved component/dumpling This is related to Dumpling of TiDB. lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dumpling is slow in 1M tables case
4 participants