Skip to content

Commit

Permalink
Fsr warmup support (#5338)
Browse files Browse the repository at this point in the history
  • Loading branch information
BornChanger committed Oct 24, 2023
1 parent 6803b50 commit 05735fa
Show file tree
Hide file tree
Showing 10 changed files with 8,630 additions and 8,611 deletions.
1 change: 1 addition & 0 deletions cmd/backup-manager/app/cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func NewRestoreCommand() *cobra.Command {
cmd.Flags().StringVar(&ro.PitrRestoredTs, "pitrRestoredTs", "0", "The pitr restored ts")
cmd.Flags().BoolVar(&ro.Prepare, "prepare", false, "Whether to prepare for restore")
cmd.Flags().StringVar(&ro.TargetAZ, "target-az", "", "For volume-snapshot restore, which az the volume snapshots restore to")
cmd.Flags().BoolVar(&ro.UseFSR, "use-fsr", false, "EBS snapshot restore use FSR for TiKV data volumes or not")
return cmd
}

Expand Down
7 changes: 7 additions & 0 deletions cmd/backup-manager/app/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type Options struct {
Prepare bool
// TargetAZ indicates which az the volume snapshots restore to. It's used in volume-snapshot mode.
TargetAZ string
// UseFSR to indicate if use FSR for TiKV data volumes during EBS snapshot restore
UseFSR bool
}

func (ro *Options) restoreData(
Expand Down Expand Up @@ -106,6 +108,11 @@ func (ro *Options) restoreData(
csbPath = path.Join(util.BRBinPath, "csb_restore.json")
args = append(args, fmt.Sprintf("--output-file=%s", csbPath))
args = append(args, fmt.Sprintf("--target-az=%s", ro.TargetAZ))
if ro.UseFSR {
args = append(args, "--use-fsr=true")
} else {
args = append(args, "--use-fsr=false")
}
progressStep = "Volume Restore"
} else {
progressStep = "Data Restore"
Expand Down
4 changes: 4 additions & 0 deletions cmd/backup-manager/app/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func validCmdFlagFunc(flag *pflag.Flag) {
return
}

if flag.Name == "use-fsr" {
return
}

cmdutil.CheckErr(fmt.Errorf(cmdHelpMsg, flag.Name))
}

Expand Down
2 changes: 1 addition & 1 deletion images/ebs-warmup/warmup-steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ while [ $# -gt 0 ]; do
die "unsupported flag $1"
;;
*)
echo "spawning wram up task: operation = $operation; file path = $1"
echo "spawning warm up task: operation = $operation; file path = $1"
case "$operation" in
fio)
device=$(dev_name_by_mount_point "$1")
Expand Down
Loading

0 comments on commit 05735fa

Please sign in to comment.