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 stuck when meeting error #33201

Merged
merged 13 commits into from
Mar 21, 2022
Merged

br: Fix stuck when meeting error #33201

merged 13 commits into from
Mar 21, 2022

Conversation

YuJuncen
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #33200

Problem Summary:

What is changed and how it works?

This make the worker of TiKVSender select over the context created by the error group(instead of its parent context), so they can get aware of the error happened and exit properly.

This also make an interface TiKVRestorer, which is the backend for TiKVSender, these can make us easier to writing unit tests.

Check List

Tests

  • Unit test

Release note

Fix a bug that caused BR get stuck when restore meets some unrecoverable error.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • joccau

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 17, 2022
Signed-off-by: Yu Juncen <[email protected]>
@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-6.0 and removed do-not-merge/needs-triage-completed labels Mar 17, 2022
@YuJuncen
Copy link
Contributor Author

[2022-03-17T07:58:10.031Z] [FAIL] planner/core TestCompareMultiFieldsInSubquery
[2022-03-17T07:58:10.031Z] err=signal: segmentation fault (core dumped)

🤔 /run-unit-test

}

func (f *fakeRestorer) RestoreFiles(ctx context.Context, files []*backuppb.File, rewriteRules *restore.RewriteRules, updateCh glue.Progress) error {
if ctx.Err() != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 do we have similar code in real RestoreFiles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably, but hidden in some internal call of the clients.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example, here:
image

@YuJuncen
Copy link
Contributor Author

/run-unit-test

Copy link
Contributor

@3pointer 3pointer 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

@YuJuncen YuJuncen requested a review from kennytm March 17, 2022 09:37
@sre-bot
Copy link
Contributor

sre-bot commented Mar 17, 2022

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 17, 2022
@YuJuncen YuJuncen requested a review from joccau March 17, 2022 09:45
@YuJuncen
Copy link
Contributor Author

/run-integration-br-tests

1 similar comment
@YuJuncen
Copy link
Contributor Author

/run-integration-br-tests

@YuJuncen
Copy link
Contributor Author

/run-integration-br-tests

@YuJuncen
Copy link
Contributor Author

/run-unit-test
/run-integration-br-tests

@YuJuncen
Copy link
Contributor Author

/run-integration-br-tests

@YuJuncen
Copy link
Contributor Author

/run-integration-tests

@3pointer
Copy link
Contributor

/run-integration-br-tests

3 similar comments
@3pointer
Copy link
Contributor

/run-integration-br-tests

@3pointer
Copy link
Contributor

/run-integration-br-tests

@3pointer
Copy link
Contributor

/run-integration-br-tests

@YuJuncen
Copy link
Contributor Author

/run-integration-br-tests

@YuJuncen
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: d2fd985

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 21, 2022
@3pointer
Copy link
Contributor

/run-all-tests

@hawkingrei
Copy link
Member

/run-unit-test

@ti-chi-bot ti-chi-bot merged commit 49f291d into pingcap:master Mar 21, 2022
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 21, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.3 in PR #33267

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 21, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-5.4 in PR #33268

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Mar 21, 2022
@ti-srebot
Copy link
Contributor

cherry pick to release-6.0 in PR #33269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. 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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BR stuck when restore meet unrecoverable errors.
7 participants