Details
-
Task
-
Status: Open (View Workflow)
-
Trivial
-
Resolution: Unresolved
-
None
-
None
Description
Here is a ugly code from replication-manager to detect if a server is a slave
var ss dbhelper.SlaveStatus
|
ss, _, errss := dbhelper.GetSlaveStatus(server.Conn, server.ClusterGroup.Conf.MasterConn, server.DBVersion)
|
// We have no replicatieon can this be the old master
|
// 1617 is no multi source channel found
|
noChannel := false
|
if errss != nil {
|
if strings.Contains(errss.Error(), "1617") || strings.Contains(errss.Error(), "3074") {
|
// This is a special case when using muti source there is a error instead of empty resultset when no replication is defined on channel
|
// server.ClusterGroup.LogPrintf(LvlInfo, " server: %s replication no channel err 1617 %s ", server.URL, errss)
|
noChannel = true
|
}
|
}
|
if errss == sql.ErrNoRows || noChannel {
|
As notice any reason not to send an empty result for show slave status for channel ? Get a consistant result with a regular show slave status , this issue is also in upstream but to make it harder error number is different