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) #57936

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #57894

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 added component/dumpling This is related to Dumpling of TiDB. 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. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Dec 3, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 3, 2024
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

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

Please upload report for BASE (release-8.5@727b279). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.5     #57936   +/-   ##
================================================
  Coverage               ?   56.8985%           
================================================
  Files                  ?       1772           
  Lines                  ?     626856           
  Branches               ?          0           
================================================
  Hits                   ?     356672           
  Misses                 ?     246015           
  Partials               ?      24169           
Flag Coverage Δ
integration 36.8287% <ø> (?)
unit 72.5465% <48.7804%> (?)

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

Components Coverage Δ
dumpling 52.8711% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 52.2463% <0.0000%> (?)

Copy link

ti-chi-bot bot commented Dec 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, 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-03 08:46:45.908239792 +0000 UTC m=+1144593.527894308: ☑️ agreed by lance6716.
  • 2024-12-03 08:49:12.466562977 +0000 UTC m=+1144740.086217492: ☑️ agreed by tangenta.

@ti-chi-bot ti-chi-bot bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Dec 3, 2024
@ti-chi-bot ti-chi-bot bot merged commit e755695 into pingcap:release-8.5 Dec 3, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. component/dumpling This is related to Dumpling of TiDB. lgtm 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. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants