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

br: Add pre-check of duplicate table in the downstream #55044

Merged
merged 34 commits into from
Aug 20, 2024

Conversation

RidRisR
Copy link
Contributor

@RidRisR RidRisR commented Jul 30, 2024

What problem does this PR solve?

Issue Number: close #55087

Problem Summary:

What changed and how does it work?

Add a pre-check of duplicate table in the downstream.
If there are tables already existed downstream, restore task will fail and list all tables blocked the task.

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.

Add a pre-check of duplicate table in the downstream.
If there are tables already existed downstream, restore task will fail and list all tables blocked the task.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 30, 2024
Copy link

tiprow bot commented Jul 30, 2024

Hi @RidRisR. 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 Jul 30, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 8 lines in your changes missing coverage. Please review.

Project coverage is 76.6185%. Comparing base (aa4e2b3) to head (c858500).
Report is 42 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #55044        +/-   ##
================================================
+ Coverage   72.9540%   76.6185%   +3.6645%     
================================================
  Files          1576       1596        +20     
  Lines        440786     444472      +3686     
================================================
+ Hits         321571     340548     +18977     
+ Misses        99448      82737     -16711     
- Partials      19767      21187      +1420     
Flag Coverage Δ
integration 52.3458% <81.2500%> (?)
tiprow_ft ?
unit 71.9805% <2.9411%> (-0.0499%) ⬇️

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

Components Coverage Δ
dumpling 52.9567% <ø> (ø)
parser ∅ <ø> (∅)
br 63.1137% <75.0000%> (+17.1365%) ⬆️

@YuJuncen
Copy link
Contributor

Would you add a unit test or a recipe for manual testing?

@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 Jul 30, 2024
Copy link
Contributor

@YuJuncen YuJuncen left a comment

Choose a reason for hiding this comment

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

rest lgtm

br/pkg/task/restore.go Outdated Show resolved Hide resolved
br/pkg/gluetidb/glue.go Outdated Show resolved Hide resolved
br/pkg/task/restore.go Outdated Show resolved Hide resolved
@RidRisR RidRisR requested a review from YuJuncen July 31, 2024 06:48
Copy link
Contributor

@YuJuncen YuJuncen left a comment

Choose a reason for hiding this comment

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

rest lgtm

br/pkg/gluetidb/glue.go Outdated Show resolved Hide resolved
br/pkg/glue/glue.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-tests-checked labels Jul 31, 2024
@RidRisR
Copy link
Contributor Author

RidRisR commented Jul 31, 2024

/test pull-br-integration-test

Copy link

tiprow bot commented Jul 31, 2024

@RidRisR: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-br-integration-test

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.

@RidRisR
Copy link
Contributor Author

RidRisR commented Jul 31, 2024

/test pull-br-integration-test

Copy link

tiprow bot commented Jul 31, 2024

@RidRisR: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-br-integration-test

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.

br/pkg/glue/glue.go Outdated Show resolved Hide resolved
br/pkg/task/restore.go Outdated Show resolved Hide resolved
This reverts commit 77e6cdb.
@YuJuncen
Copy link
Contributor

/test check-dev2

Copy link

tiprow bot commented Aug 19, 2024

@YuJuncen: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test check-dev2

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.

@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 Aug 19, 2024
@RidRisR
Copy link
Contributor Author

RidRisR commented Aug 19, 2024

/test check-dev2

Copy link

tiprow bot commented Aug 19, 2024

@RidRisR: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test check-dev2

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.

@RidRisR
Copy link
Contributor Author

RidRisR commented Aug 19, 2024

/test pull-br-integration-test

@RidRisR
Copy link
Contributor Author

RidRisR commented Aug 19, 2024

/test check-dev

Copy link

ti-chi-bot bot commented Aug 19, 2024

@RidRisR: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test build
  • /test check-dev
  • /test check-dev2
  • /test mysql-test
  • /test pull-br-integration-test
  • /test pull-integration-ddl-test
  • /test pull-lightning-integration-test
  • /test pull-mysql-client-test
  • /test unit-test

The following commands are available to trigger optional jobs:

  • /test canary-notify-when-compatibility-sections-changed
  • /test pingcap/tidb/canary_ghpr_unit_test
  • /test pull-common-test
  • /test pull-e2e-test
  • /test pull-integration-common-test
  • /test pull-integration-copr-test
  • /test pull-integration-jdbc-test
  • /test pull-integration-mysql-test
  • /test pull-integration-nodejs-test
  • /test pull-sqllogic-test
  • /test pull-tiflash-test

Use /test all to run the following jobs that were automatically triggered:

  • pingcap/tidb/ghpr_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test
  • pingcap/tidb/pull_br_integration_test
  • pingcap/tidb/pull_integration_ddl_test
  • pingcap/tidb/pull_mysql_client_test

In response to this:

/test check-dev

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/test-infra repository.

Copy link

tiprow bot commented Aug 19, 2024

@RidRisR: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test pull-br-integration-test

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

tiprow bot commented Aug 19, 2024

@RidRisR: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test check-dev

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.

@RidRisR
Copy link
Contributor Author

RidRisR commented Aug 20, 2024

/test check-dev

Copy link

tiprow bot commented Aug 20, 2024

@RidRisR: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test check-dev

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.

@ti-chi-bot ti-chi-bot bot merged commit f471302 into pingcap:master Aug 20, 2024
27 of 28 checks passed
@RidRisR RidRisR deleted the duptable branch September 29, 2024 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

br: we need to add a pre-check to prevent user restore data into a existed table
5 participants