Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
Closed
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
11 changes: 10 additions & 1 deletion go/inst/instance_topology_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,17 @@ func SetSemiSyncReplica(instanceKey *InstanceKey, enableReplica bool) (*Instance
return ReadTopologyInstance(instanceKey)
}

func StartSQLThreadQuick(instanceKey *InstanceKey) error {
cmd := `start slave sql_thread`
if _, err := ExecInstance(instanceKey, cmd); err != nil {
return log.Errorf("%+v: StartSQLThreadQuickly: '%q' failed: %+v", *instanceKey, cmd, err)
}
log.Infof("%s on %+v as part of StartSQLThreadQuickly", cmd, *instanceKey)
return nil
}

func RestartReplicationQuick(instanceKey *InstanceKey) error {
for _, cmd := range []string{`stop slave io_thread`, `start slave io_thread`} {
for _, cmd := range []string{`stop slave io_thread`, `start slave io_thread`, `start slave sql_thread`} {
if _, err := ExecInstance(instanceKey, cmd); err != nil {
return log.Errorf("%+v: RestartReplicationQuick: '%q' failed: %+v", *instanceKey, cmd, err)
} else {
Expand Down
4 changes: 4 additions & 0 deletions go/logic/topology_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -1578,10 +1578,14 @@ func emergentlyRestartReplicationOnTopologyInstance(instanceKey *inst.InstanceKe
// with losing relay logs, then we've lost data.
// So, unfortunately we avoid this step in MariaDB GTID.
// See https://github.com/openark/orchestrator/issues/1260

// We will only start SQL thread
inst.StartSQLThreadQuick(instanceKey)
return
}

inst.RestartReplicationQuick(instanceKey)
inst.StartSQLThreadQuick(instanceKey)
inst.AuditOperation("emergently-restart-replication-topology-instance", instanceKey, string(analysisCode))
})
}
Expand Down