Skip to content
Merged
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
10 changes: 5 additions & 5 deletions go/vt/mysqlctl/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,6 @@ func backupFile(ctx context.Context, mysqld MysqlDaemon, logger logutil.Logger,
// satisfied (there is a DB with tables).
// Returns non-nil error if one occurs while trying to perform the check.
func checkNoDB(ctx context.Context, mysqld MysqlDaemon, dbName string) (bool, error) {
// Wait for mysqld to be ready, in case it was launched in parallel with us.
if err := mysqld.Wait(ctx); err != nil {
return false, err
}

qr, err := mysqld.FetchSuperQuery(ctx, "SHOW DATABASES")
if err != nil {
return false, fmt.Errorf("checkNoDB failed: %v", err)
Expand Down Expand Up @@ -741,6 +736,11 @@ func Restore(
deleteBeforeRestore bool,
dbName string) (mysql.Position, error) {

// Wait for mysqld to be ready, in case it was launched in parallel with us.
if err := mysqld.Wait(ctx); err != nil {
return mysql.Position{}, err
}

// find the right backup handle: most recent one, with a MANIFEST
logger.Infof("Restore: looking for a suitable backup to restore")
bs, err := backupstorage.GetBackupStorage()
Expand Down