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

v15: backport: fixing issue with xtrabackup and long gtids (#16304) #512

Closed
wants to merge 2 commits into from
Closed
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
16 changes: 8 additions & 8 deletions go/vt/mysqlctl/xtrabackupengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ import (
// it implements the BackupEngine interface and contains all the logic
// required to implement a backup/restore by invoking xtrabackup with
// the appropriate parameters
type XtrabackupEngine struct {
}
type XtrabackupEngine struct{}

var (
// path where backup engine program is located
Expand Down Expand Up @@ -156,7 +155,6 @@ func closeFile(wc io.WriteCloser, fileName string, logger logutil.Logger, finalE
// ExecuteBackup returns a boolean that indicates if the backup is usable,
// and an overall error.
func (be *XtrabackupEngine) ExecuteBackup(ctx context.Context, params BackupParams, bh backupstorage.BackupHandle) (complete bool, finalErr error) {

if xtrabackupUser == "" {
return false, vterrors.New(vtrpc.Code_INVALID_ARGUMENT, "xtrabackupUser must be specified.")
}
Expand Down Expand Up @@ -248,7 +246,8 @@ func (be *XtrabackupEngine) backupFiles(
flavor string,
) (replicationPosition mysql.Position, finalErr error) {
backupProgram := path.Join(xtrabackupEnginePath, xtrabackupBinaryName)
flagsToExec := []string{"--defaults-file=" + params.Cnf.Path,
flagsToExec := []string{
"--defaults-file=" + params.Cnf.Path,
"--backup",
"--socket=" + params.Cnf.SocketFile,
"--slave-info",
Expand Down Expand Up @@ -414,7 +413,6 @@ func (be *XtrabackupEngine) backupFiles(

// ExecuteRestore restores from a backup. Any error is returned.
func (be *XtrabackupEngine) ExecuteRestore(ctx context.Context, params RestoreParams, bh backupstorage.BackupHandle) (*BackupManifest, error) {

var bm xtraBackupManifest

if err := getBackupManifestInto(ctx, bh, &bm); err != nil {
Expand Down Expand Up @@ -477,7 +475,8 @@ func (be *XtrabackupEngine) restoreFromBackup(ctx context.Context, cnf *Mycnf, b
logger.Infof("Restore: Preparing the extracted files")
// prepare the backup
restoreProgram := path.Join(xtrabackupEnginePath, xtrabackupBinaryName)
flagsToExec := []string{"--defaults-file=" + cnf.Path,
flagsToExec := []string{
"--defaults-file=" + cnf.Path,
"--prepare",
"--target-dir=" + tempDir,
}
Expand Down Expand Up @@ -512,7 +511,8 @@ func (be *XtrabackupEngine) restoreFromBackup(ctx context.Context, cnf *Mycnf, b
// then move-back
logger.Infof("Restore: Move extracted and prepared files to final locations")

flagsToExec = []string{"--defaults-file=" + cnf.Path,
flagsToExec = []string{
"--defaults-file=" + cnf.Path,
"--move-back",
"--target-dir=" + tempDir,
}
Expand Down Expand Up @@ -579,7 +579,7 @@ func (be *XtrabackupEngine) extractFiles(ctx context.Context, logger logutil.Log
// Create the decompressor if needed.
if compressed {
var decompressor io.ReadCloser
var deCompressionEngine = bm.CompressionEngine
deCompressionEngine := bm.CompressionEngine
if deCompressionEngine == "" {
// For backward compatibility. Incase if Manifest is from N-1 binary
// then we assign the default value of compressionEngine.
Expand Down
Loading