-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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: Fail backup if any snapshots failed #53038
br: Fail backup if any snapshots failed #53038
Conversation
Welcome @michaelmdeng! |
Hi @michaelmdeng. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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/test-infra repository. |
9b88ab9
to
b15b738
Compare
} else if *s.State == ec2.SnapshotStateError { | ||
log.Error("snapshot failed", zap.String("id", *s.SnapshotId), zap.String("error", (*s.StateMessage))) | ||
return 0, errors.Errorf("snapshot %s failed", *s.SnapshotId) |
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.
Looks great Backup metadata is still generated, and contains the snapshot ids. So cleanup should delete the snapshots.
tidb/br/pkg/task/backup_ebs.go
Lines 228 to 255 in ede3585
snapIDMap, volAZs, err = ec2Session.CreateSnapshots(backupInfo) | |
if err != nil { | |
// TODO maybe we should consider remove snapshots already exists in a failure | |
return errors.Trace(err) | |
} | |
// Step.3 save backup meta file to s3. | |
// NOTE: maybe define the meta file in kvproto in the future. | |
// but for now json is enough. | |
backupInfo.SetClusterVersion(normalizedVer.String()) | |
backupInfo.SetFullBackupType(string(cfg.FullBackupType)) | |
backupInfo.SetResolvedTS(resolvedTs) | |
backupInfo.SetSnapshotIDs(snapIDMap) | |
backupInfo.SetVolumeAZs(volAZs) | |
err = saveMetaFile(c, backupInfo, client.GetStorage()) | |
if err != nil { | |
return err | |
} | |
if !cfg.SkipPauseGCAndScheduler { | |
log.Info("snapshot started, restore schedule") | |
if restoreE := goBackupToNormal(ctx); restoreE != nil { | |
log.Warn("failed to restore removed schedulers, you may need to restore them manually", zap.Error(restoreE)) | |
} | |
} | |
log.Info("wait async snapshots finish") | |
totalSize, err = ec2Session.WaitSnapshotsCreated(snapIDMap, progress) |
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.
I wonder though, how much time does it take for AWS to mark the snapshots as failed.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BornChanger, 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 |
[LGTM Timeline notifier]Timeline:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #53038 +/- ##
================================================
+ Coverage 72.0329% 74.3287% +2.2957%
================================================
Files 1499 1510 +11
Lines 431222 443332 +12110
================================================
+ Hits 310622 329523 +18901
+ Misses 101291 93586 -7705
- Partials 19309 20223 +914
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@michaelmdeng: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
@BornChanger : Is the test failure relevant. |
Can I get a retest? updated to fix lint errors |
f402bd4
to
c08d578
Compare
Please cherrypick to release-6.5 and release-7.5 |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
close pingcap#53037 Co-authored-by: Michael Deng <33045922+michaelmdeng@users.noreply.github.com>
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
During EBS snapshot backup, if any snapshots fail, the backup will be stuck indefinitely checking the snapshots that failed. Since we only run a single backup at a time, this also blocks subsequent backups.
Issue Number: close #53037
Problem Summary: Backup stuck when EBS snapshot failed
What changed and how does it work?
Update snapshot backup process to fail if it detects snapshots in failed state. We observe rare snapshot failures due to underlying EBS hardware issues.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.