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: check table-list types before dumping #53683

Merged
merged 5 commits into from
Jun 3, 2024

Conversation

tangenta
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #53682

Problem Summary:

When users specify table-list explicitly, Dumpling will not query the table types.

tidb/dumpling/export/dump.go

Lines 1147 to 1150 in 5e5326b

func prepareTableListToDump(tctx *tcontext.Context, conf *Config, db *sql.Conn) error {
if conf.SpecifiedTables || conf.SQL != "" {
return nil
}

As a result, all tables are considered as TableTypeBase and query the meta with SHOW CREATE TABLE later.

If there is a view in table-list, SHOW CREATE TABLE will return the unexpected result:

expected 4 destination arguments in Scan, not 2

What changed and how does it work?

Query table types even if table-list is specified.

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.

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. component/dumpling This is related to Dumpling of TiDB. labels May 30, 2024
Copy link

tiprow bot commented May 30, 2024

Hi @tangenta. 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 May 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 112 lines in your changes missing coverage. Please review.

Project coverage is 75.1141%. Comparing base (e6d1899) to head (2d539ed).
Report is 1203 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53683        +/-   ##
================================================
+ Coverage   74.4090%   75.1141%   +0.7050%     
================================================
  Files          1505       1507         +2     
  Lines        357373     442383     +85010     
================================================
+ Hits         265918     332292     +66374     
- Misses        72128      90071     +17943     
- Partials      19327      20020       +693     
Flag Coverage Δ
integration 49.8465% <ø> (?)
unit 71.8506% <0.0000%> (-1.4234%) ⬇️

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

Components Coverage Δ
dumpling 52.9656% <0.0000%> (-3.3316%) ⬇️
parser ∅ <ø> (∅)
br 50.2605% <ø> (+7.1996%) ⬆️

dumpling/export/sql.go Outdated Show resolved Hide resolved
dumpling/export/sql.go Outdated Show resolved Hide resolved
dumpling/export/sql.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 3, 2024
Copy link
Contributor

@GMHDBJD GMHDBJD 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 Jun 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GMHDBJD, lance6716

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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 3, 2024
Copy link

ti-chi-bot bot commented Jun 3, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-03 01:48:44.80957997 +0000 UTC m=+3259478.566715542: ☑️ agreed by lance6716.
  • 2024-06-03 06:50:33.597230728 +0000 UTC m=+3277587.354366314: ☑️ agreed by GMHDBJD.

@ti-chi-bot ti-chi-bot bot merged commit 073f746 into pingcap:master Jun 3, 2024
27 checks passed
@tangenta tangenta added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Jun 3, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 3, 2024
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label Jun 4, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 4, 2024
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Jul 11, 2024
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Oct 28, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 28, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tidb#release-7.1 from head ti-chi-bot:cherry-pick-53683-to-release-7.1: the GitHub API request returns a 403 error: {"message":"You have exceeded a secondary rate limit and have been temporarily blocked from content creation. Please retry your request again later. If you reach out to GitHub Support for help, please include the request ID ACA6:3F108B:1B90108:33F1F52:671F46BA and timestamp 2024-10-28 08:09:33 UTC.","documentation_url":"https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits","status":"403"}

@Benjamin2037 Benjamin2037 added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. and removed needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. labels Nov 4, 2024
@wuhuizuo
Copy link
Contributor

wuhuizuo commented Nov 4, 2024

/cherry-pick release-7.1

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 4, 2024
@ti-chi-bot
Copy link
Member

@wuhuizuo: new pull request could not be created: failed to create pull request against pingcap/tidb#release-7.1 from head ti-chi-bot:cherry-pick-53683-to-release-7.1: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-53683-to-release-7.1."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request","status":"422"}

In response to this:

/cherry-pick release-7.1

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 ti-community-infra/tichi repository.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 4, 2024
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2024
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-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 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 failed when mix tables and views in "tables-list"
6 participants