Skip to content

Commit

Permalink
Incremental restore: copy files under Vitess dataroot dir
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Mar 11, 2024
1 parent 4c70c7e commit fa7000e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/vt/mysqlctl/builtinbackupengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"vitess.io/vitess/go/mysql/replication"
"vitess.io/vitess/go/protoutil"
"vitess.io/vitess/go/vt/concurrency"
vtenv "vitess.io/vitess/go/vt/env"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/logutil"
stats "vitess.io/vitess/go/vt/mysqlctl/backupstats"
Expand Down Expand Up @@ -942,6 +943,7 @@ func (be *BuiltinBackupEngine) executeRestoreIncrementalBackup(ctx context.Conte
if err != nil {
return vterrors.Wrap(err, "failed to restore file")
}

req := &mysqlctlpb.ApplyBinlogFileRequest{
BinlogFileName: binlogFile,
BinlogRestoreDatetime: protoutil.TimeToProto(params.RestoreToTimestamp),
Expand Down Expand Up @@ -1006,7 +1008,7 @@ func (be *BuiltinBackupEngine) restoreFiles(ctx context.Context, params RestoreP
}

if bm.Incremental {
createdDir, err = os.MkdirTemp("", "restore-incremental-*")
createdDir, err = os.MkdirTemp(vtenv.VtDataRoot(), "restore-incremental-*")

Check warning on line 1011 in go/vt/mysqlctl/builtinbackupengine.go

View check run for this annotation

Codecov / codecov/patch

go/vt/mysqlctl/builtinbackupengine.go#L1011

Added line #L1011 was not covered by tests
if err != nil {
return "", err
}
Expand Down

0 comments on commit fa7000e

Please sign in to comment.