Skip to content

Commit

Permalink
br: save meta file for ebs backup earlier (#44805) (#45098)
Browse files Browse the repository at this point in the history
close #44806
  • Loading branch information
ti-chi-bot authored Jun 30, 2023
1 parent d52ff9d commit 09ecce1
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions br/pkg/task/backup_ebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,19 @@ func RunBackupEBS(c context.Context, g glue.Glue, cfg *BackupConfig) error {
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 := restoreFunc(ctx); restoreE != nil {
Expand Down Expand Up @@ -247,18 +260,6 @@ func RunBackupEBS(c context.Context, g glue.Glue, cfg *BackupConfig) error {
}
progress.Close()

// 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
}
finished = true
return nil
}
Expand Down

0 comments on commit 09ecce1

Please sign in to comment.