diff --git a/server/modules/monitor/mariadbmon/mariadbserver.cc b/server/modules/monitor/mariadbmon/mariadbserver.cc index 74a7dfd51..64616a7b8 100644 --- a/server/modules/monitor/mariadbmon/mariadbserver.cc +++ b/server/modules/monitor/mariadbmon/mariadbserver.cc @@ -1936,11 +1936,6 @@ bool MariaDBServer::merge_slave_conns(ClusterOperation& op, const SlaveStatusArr SlaveStatus slave_conn = conns_to_merge[i]; string ignore_reason; if (conn_can_be_merged(slave_conn, &ignore_reason)) - { - MXS_WARNING("%s was ignored when promoting %s because %s", - slave_conn.to_short_string().c_str(), name(), ignore_reason.c_str()); - } - else { if (check_modify_conn_name(&slave_conn)) { @@ -1958,6 +1953,12 @@ bool MariaDBServer::merge_slave_conns(ClusterOperation& op, const SlaveStatusArr error = true; } } + else + { + mxb_assert(!ignore_reason.empty()); + MXS_WARNING("%s was ignored when promoting %s because %s", + slave_conn.to_short_string().c_str(), name(), ignore_reason.c_str()); + } } return !error;