Skip to content
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
5 changes: 5 additions & 0 deletions go/vt/mysqlctl/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ func backup(ctx context.Context, mysqld MysqlDaemon, logger logutil.Logger, bh b
usable := backupErr == nil

// Try to restart mysqld
err = mysqld.RefreshConfig()
if err != nil {
return usable, fmt.Errorf("can't refresh mysqld config: %v", err)
}

err = mysqld.Start(ctx)
if err != nil {
return usable, fmt.Errorf("can't restart mysqld: %v", err)
Expand Down
6 changes: 6 additions & 0 deletions go/vt/mysqlctl/mysql_daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type MysqlDaemon interface {
Shutdown(ctx context.Context, waitForMysqld bool) error
RunMysqlUpgrade() error
ReinitConfig(ctx context.Context) error
RefreshConfig() error
Wait(ctx context.Context) error

// GetMysqlPort returns the current port mysql is listening on.
Expand Down Expand Up @@ -263,6 +264,11 @@ func (fmd *FakeMysqlDaemon) ReinitConfig(ctx context.Context) error {
return nil
}

// RefreshConfig is part of the MysqlDaemon interface
func (fmd *FakeMysqlDaemon) RefreshConfig() error {
return nil
}

// Wait is part of the MysqlDaemon interface.
func (fmd *FakeMysqlDaemon) Wait(ctx context.Context) error {
return nil
Expand Down
14 changes: 6 additions & 8 deletions test/tablet.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,13 @@ def start_vttablet(
if supports_backups:
args.extend(['-restore_from_backup'] + get_backup_storage_flags())

# When vttablet restores from backup, and if not using
# mysqlctld, it will re-generate the .cnf file. So we need to
# When vttablet restores from backup, it will re-generate the .cnf file. So we need to
# have EXTRA_MY_CNF set properly.
if not self.use_mysqlctld:
all_extra_my_cnf = get_all_extra_my_cnf(None)
if all_extra_my_cnf:
if not extra_env:
extra_env = {}
extra_env['EXTRA_MY_CNF'] = ':'.join(all_extra_my_cnf)
all_extra_my_cnf = get_all_extra_my_cnf(None)
if all_extra_my_cnf:
if not extra_env:
extra_env = {}
extra_env['EXTRA_MY_CNF'] = ':'.join(all_extra_my_cnf)

if extra_args:
args.extend(extra_args)
Expand Down