Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

br/restore: add version check for backup schema_version (#929) #1090

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #929

What problem does this PR solve?

a special fix for v4.0 versions of #790

Because #685 cannot be cherry-picked to release-4.0, 4.0.x BR would corrupt 4.0 clusters without even a warn message when the backup archive come from a table with non-int clustered primary key. This PR would add a check to the backup archive version, and intercept restoring from incompatible backup archives.

What is changed and how it works?

CheckClusterVersion was changed to check version in different way.
And added a check to cluster version stored in backupmeta during restore. (after reading backup meta)

Currently, this check only checks major versions (because of clustered index).

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported function/method change
    signature change for CheckClusterVersion.
- CheckClusterVersion(ctx context.Context, client pd.Client) error
+ CheckClusterVersion(ctx context.Context, client pd.Client, checker VerChecker) error

Release Note

  • BR would check cluster version of backup now.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@3pointer 3pointer force-pushed the cherry-pick-929-to-release-4.0 branch from 7eed6c7 to 0981f40 Compare May 10, 2021 08:44
Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

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

/lgtm

@3pointer
Copy link
Collaborator

/lgtm

@ti-chi-bot
Copy link
Member Author

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • lonng

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 LGTM2 and removed status/LGT1 LGTM1 labels May 11, 2021
@3pointer 3pointer added this to the v4.0.13 milestone May 11, 2021
@lonng
Copy link
Contributor

lonng commented May 11, 2021

/merge

@ti-chi-bot
Copy link
Member Author

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

Commit hash: 0981f40

@ti-chi-bot
Copy link
Member Author

@ti-chi-bot: Your PR was out of date, I have automatically updated it for you.

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 ti-chi-bot merged commit 40c1967 into pingcap:release-4.0 May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants