-
Notifications
You must be signed in to change notification settings - Fork 102
br/restore: add version check for backup schema_version #929
Conversation
/run-all-tests |
/build |
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.
rest LGTM
@@ -199,3 +224,20 @@ func CheckTiDBVersion(versionStr string, requiredMinVersion, requiredMaxVersion | |||
} | |||
return CheckVersion("TiDB", *version, requiredMinVersion, requiredMaxVersion) | |||
} | |||
|
|||
// NormalizeBackupVersion normalizes the version string from backupmeta. | |||
func NormalizeBackupVersion(version string) *semver.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.
Seem version.removeVAndHash
can be replaced by this funcation.
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.
You mean merge those two functions? Seems removeVAndHash
focus on the version string made by the make script, and NormalizeBackupVersion
focus on the version string returned from PD. Maybe it wouldn't work if we just replace the former with the latter. 🤔
Co-authored-by: Neil Shen <overvenus@gmail.com>
/run-integration-tests port in use |
listen tcp 0.0.0.0:10080: bind: address already in use /run-integration-tests |
/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: c568f98
|
[2021-05-08T11:29:42.533Z] [2021/05/08 19:29:40.505 +08:00] [INFO] [restore_raw.go:110] ["all files are filtered out from the backup archive, nothing to restore"] /run-integration-tests |
/run-integration-tests |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created: #1090. |
In response to a cherrypick label: new pull request created: #1091. |
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