From 54de310f7b3df4dd14cf4bab700152b265ab838a Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Wed, 1 Mar 2017 13:16:57 +0200 Subject: [PATCH 1/2] more relaxed and safe detection of GTID failover case --- go/inst/analysis_dao.go | 7 ++----- resources/public/js/orchestrator.js | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/go/inst/analysis_dao.go b/go/inst/analysis_dao.go index cc60e08ae..8cdb6fef8 100644 --- a/go/inst/analysis_dao.go +++ b/go/inst/analysis_dao.go @@ -138,9 +138,6 @@ func GetReplicationAnalysis(clusterName string, includeDowntimed bool, auditAnal SUM( slave_instance.oracle_gtid ) AS count_oracle_gtid_slaves, - IFNULL(SUM(slave_instance.last_checked <= slave_instance.last_seen - AND slave_instance.oracle_gtid != 0), - 0) AS count_valid_oracle_gtid_slaves, SUM( slave_instance.binlog_server ) AS count_binlog_server_slaves, @@ -233,8 +230,8 @@ func GetReplicationAnalysis(clusterName string, includeDowntimed bool, auditAnal a.SlaveHosts = *NewInstanceKeyMap() a.SlaveHosts.ReadCommaDelimitedList(m.GetString("slave_hosts")) - countValidOracleGTIDSlaves := m.GetUint("count_valid_oracle_gtid_slaves") - a.OracleGTIDImmediateTopology = countValidOracleGTIDSlaves == a.CountValidReplicas && a.CountValidReplicas > 0 + countOracleGTIDSlaves := m.GetUint("count_oracle_gtid_slaves") + a.OracleGTIDImmediateTopology = countOracleGTIDSlaves > 0 && a.CountValidReplicas > 0 countValidMariaDBGTIDSlaves := m.GetUint("count_valid_mariadb_gtid_slaves") a.MariaDBGTIDImmediateTopology = countValidMariaDBGTIDSlaves == a.CountValidReplicas && a.CountValidReplicas > 0 countValidBinlogServerSlaves := m.GetUint("count_valid_binlog_server_slaves") diff --git a/resources/public/js/orchestrator.js b/resources/public/js/orchestrator.js index cdca7606e..8f20f08ec 100644 --- a/resources/public/js/orchestrator.js +++ b/resources/public/js/orchestrator.js @@ -567,7 +567,7 @@ function normalizeInstance(instance) { instance.replicationAttemptingToRun = instance.Slave_SQL_Running || instance.Slave_IO_Running; instance.replicationLagReasonable = Math.abs(instance.SlaveLagSeconds.Int64 - instance.SQLDelay) <= 10; instance.isSeenRecently = instance.SecondsSinceLastSeen.Valid && instance.SecondsSinceLastSeen.Int64 <= 3600; - instance.usingGTID = instance.UsingOracleGTID || instance.UsingMariaDBGTID; + instance.usingGTID = instance.UsingOracleGTID || instance.SupportsOracleGTID || instance.UsingMariaDBGTID; instance.isMaxScale = (instance.Version.indexOf("maxscale") >= 0); // used by cluster-tree From 8823251e66da4edfead86138036c97d4b8dad702 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 6 Mar 2017 09:02:44 +0200 Subject: [PATCH 2/2] reverting earlier commit. We do expect count valid oracle GTID replicas --- go/inst/analysis_dao.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go/inst/analysis_dao.go b/go/inst/analysis_dao.go index 8cdb6fef8..cc60e08ae 100644 --- a/go/inst/analysis_dao.go +++ b/go/inst/analysis_dao.go @@ -138,6 +138,9 @@ func GetReplicationAnalysis(clusterName string, includeDowntimed bool, auditAnal SUM( slave_instance.oracle_gtid ) AS count_oracle_gtid_slaves, + IFNULL(SUM(slave_instance.last_checked <= slave_instance.last_seen + AND slave_instance.oracle_gtid != 0), + 0) AS count_valid_oracle_gtid_slaves, SUM( slave_instance.binlog_server ) AS count_binlog_server_slaves, @@ -230,8 +233,8 @@ func GetReplicationAnalysis(clusterName string, includeDowntimed bool, auditAnal a.SlaveHosts = *NewInstanceKeyMap() a.SlaveHosts.ReadCommaDelimitedList(m.GetString("slave_hosts")) - countOracleGTIDSlaves := m.GetUint("count_oracle_gtid_slaves") - a.OracleGTIDImmediateTopology = countOracleGTIDSlaves > 0 && a.CountValidReplicas > 0 + countValidOracleGTIDSlaves := m.GetUint("count_valid_oracle_gtid_slaves") + a.OracleGTIDImmediateTopology = countValidOracleGTIDSlaves == a.CountValidReplicas && a.CountValidReplicas > 0 countValidMariaDBGTIDSlaves := m.GetUint("count_valid_mariadb_gtid_slaves") a.MariaDBGTIDImmediateTopology = countValidMariaDBGTIDSlaves == a.CountValidReplicas && a.CountValidReplicas > 0 countValidBinlogServerSlaves := m.GetUint("count_valid_binlog_server_slaves")