Skip to content
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

Fsr warmup support #5338

Merged
merged 7 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading