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: fix tiflash confilct #53658

Merged
merged 9 commits into from
Jun 5, 2024
Merged

br: fix tiflash confilct #53658

merged 9 commits into from
Jun 5, 2024

Conversation

RidRisR
Copy link
Contributor

@RidRisR RidRisR commented May 29, 2024

What problem does this PR solve?

Issue Number: close #52628

Problem Summary:
Run PITR for multiple times could lead to tiflash crash

What changed and how does it work?

Added a new check to prevent pitr if there is tiflash replica on table in pitr range

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.

Prevent pitr when the target tables have tiflash replica

@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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels May 29, 2024
Copy link

ti-chi-bot bot commented May 29, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 29, 2024
Copy link

tiprow bot commented May 29, 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.

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/needs-triage-completed and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/needs-linked-issue labels May 30, 2024
@RidRisR RidRisR changed the title br: tiflash confilct br: fix tiflash confilct May 30, 2024
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels May 30, 2024
@RidRisR RidRisR marked this pull request as ready for review May 30, 2024 07:03
@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 May 30, 2024
Copy link

codecov bot commented May 30, 2024

Codecov Report

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

Project coverage is 57.4860%. Comparing base (df64c34) to head (6e6da7c).
Report is 74 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #53658         +/-   ##
=================================================
- Coverage   72.4222%   57.4860%   -14.9362%     
=================================================
  Files          1505       1628        +123     
  Lines        430553     617694     +187141     
=================================================
+ Hits         311816     355088      +43272     
- Misses        99427     239095     +139668     
- Partials      19310      23511       +4201     
Flag Coverage Δ
integration 39.0805% <0.0000%> (?)
unit 72.2871% <0.0000%> (+0.8856%) ⬆️

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

Components Coverage Δ
dumpling 52.9656% <ø> (-1.0302%) ⬇️
parser ∅ <ø> (∅)
br 61.4984% <0.0000%> (+20.1113%) ⬆️

@RidRisR
Copy link
Contributor Author

RidRisR commented May 30, 2024

/test pull-br-integration-test

Copy link

tiprow bot commented May 30, 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 May 30, 2024

/test pull-br-integration-test

Copy link

tiprow bot commented May 30, 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 May 31, 2024

/test pull-br-integration-test

Copy link

tiprow bot commented May 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/task/stream.go Outdated Show resolved Hide resolved
@RidRisR RidRisR requested a review from Leavrth June 3, 2024 08:44
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/tests/br_tiflash_conflict/prepare_data/insert_data.sql Outdated Show resolved Hide resolved
@@ -0,0 +1,35 @@
-- Switch to the test database
Copy link
Contributor

Choose a reason for hiding this comment

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

Also you may add license header in each file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems that most .sql don't have a license header?

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 3, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Jun 3, 2024
Copy link

ti-chi-bot bot commented Jun 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Leavrth, YuJuncen

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

ti-chi-bot bot commented Jun 3, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-03 08:51:18.706146458 +0000 UTC m=+3284832.463282031: ☑️ agreed by YuJuncen.
  • 2024-06-03 09:50:13.3868593 +0000 UTC m=+3288367.143994862: ☑️ agreed by Leavrth.

@ti-chi-bot ti-chi-bot bot merged commit 89adc33 into pingcap:master Jun 5, 2024
26 of 28 checks passed
for _, table := range info.SchemaTables(schema) {
tableInfo := table.Meta()
if tableInfo.TiFlashReplica != nil && tableInfo.TiFlashReplica.Count > 0 {
return nil, errors.Errorf("exist table(s) have tiflash replica, please remove it before restore")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we give a more explicit reason which table(s) has tiflash replica in the error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but it may make the error message too long to read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm 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.

PITR: Run PITR for multiple times could lead to tiflash crash
4 participants