diff --git a/cluster/srv_del.go b/cluster/srv_del.go index 9c4fff423..2ac496cc5 100644 --- a/cluster/srv_del.go +++ b/cluster/srv_del.go @@ -121,4 +121,5 @@ func (server *ServerMonitor) DelBackupTypeCookie(backtype string) error { func (server *ServerMonitor) DelMaintenance() { server.IsMaintenance = false + server.ClusterGroup.SetProxyServerMaintenance(server.ServerID) } diff --git a/cluster/srv_set.go b/cluster/srv_set.go index 13710451a..933eac52c 100644 --- a/cluster/srv_set.go +++ b/cluster/srv_set.go @@ -188,6 +188,7 @@ func (server *ServerMonitor) SetReadWrite() error { func (server *ServerMonitor) SetMaintenance() { server.IsMaintenance = true + server.ClusterGroup.SetProxyServerMaintenance(server.ServerID) } func (server *ServerMonitor) SetDSN() { diff --git a/server/api_database.go b/server/api_database.go index 10a5c78ea..6d1c4d601 100644 --- a/server/api_database.go +++ b/server/api_database.go @@ -765,7 +765,6 @@ func (repman *ReplicationManager) handlerMuxServerSetMaintenance(w http.Response node := mycluster.GetServerFromName(vars["serverName"]) if node != nil { node.SetMaintenance() - mycluster.SetProxyServerMaintenance(node.ServerID) } else { http.Error(w, "Server Not Found", 500) return @@ -788,7 +787,6 @@ func (repman *ReplicationManager) handlerMuxServerDelMaintenance(w http.Response node := mycluster.GetServerFromName(vars["serverName"]) if node != nil { node.DelMaintenance() - mycluster.SetProxyServerMaintenance(node.ServerID) } else { http.Error(w, "Server Not Found", 500) return