-
Notifications
You must be signed in to change notification settings - Fork 102
br/restore: add version check for backup schema_version (#929) #1091
br/restore: add version check for backup schema_version (#929) #1091
Conversation
Co-authored-by: Neil Shen <overvenus@gmail.com>
/run-all-tests |
pkg/task/restore.go
Outdated
@@ -6,6 +6,8 @@ import ( | |||
"context" | |||
"time" | |||
|
|||
"github.com/pingcap/br/pkg/version" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please optimize the imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: f6a1646
|
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
Code changes
signature change for
CheckClusterVersion
.Release Note