Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

emergentlyRestartReplicationOnTopologyInstance fixes #1010

Merged
merged 3 commits into from
Nov 24, 2019
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
9 changes: 5 additions & 4 deletions go/inst/instance_topology_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,12 @@ func SetSemiSyncReplica(instanceKey *InstanceKey, enableReplica bool) (*Instance

}

func RestartIOThread(instanceKey *InstanceKey) error {
for _, cmd := range []string{`stop slave io_thread`, `start slave io_thread`} {
func RestartReplicationQuick(instanceKey *InstanceKey) error {
for _, cmd := range []string{`stop slave sql_thread`, `stop slave io_thread`, `start slave io_thread`, `start slave sql_thread`} {
if _, err := ExecInstance(instanceKey, cmd); err != nil {
return log.Errorf("%+v: RestartIOThread: '%q' failed: %+v", *instanceKey, cmd, err)
return log.Errorf("%+v: RestartReplicationQuick: '%q' failed: %+v", *instanceKey, cmd, err)
} else {
log.Infof("%s on %+v as part of RestartReplicationQuick", cmd, *instanceKey)
}
}
return nil
Expand Down Expand Up @@ -400,7 +402,6 @@ func StopSlave(instanceKey *InstanceKey) (*Instance, error) {
}
}
if err != nil {

return instance, log.Errore(err)
}
instance, err = ReadTopologyInstance(instanceKey)
Expand Down
5 changes: 3 additions & 2 deletions go/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ func emergentlyRestartReplicationOnTopologyInstance(instanceKey *inst.InstanceKe
return
}
go inst.ExecuteOnTopology(func() {
inst.RestartIOThread(instanceKey)
inst.RestartReplicationQuick(instanceKey)
inst.AuditOperation("emergently-restart-replication-topology-instance", instanceKey, string(analysisCode))
})
}
Expand Down Expand Up @@ -1444,7 +1444,8 @@ func emergentlyRestartReplicationOnTopologyInstanceReplicas(instanceKey *inst.In
return
}
for _, replica := range replicas {
go emergentlyRestartReplicationOnTopologyInstance(&replica.Key, analysisCode)
replicaKey := &replica.Key
go emergentlyRestartReplicationOnTopologyInstance(replicaKey, analysisCode)
}
}

Expand Down