diff --git a/go/vt/vtorc/inst/analysis.go b/go/vt/vtorc/inst/analysis.go index be254cb718a..bfa123c1a8a 100644 --- a/go/vt/vtorc/inst/analysis.go +++ b/go/vt/vtorc/inst/analysis.go @@ -54,7 +54,6 @@ const ( AllPrimaryReplicasNotReplicatingOrDead AnalysisCode = "AllPrimaryReplicasNotReplicatingOrDead" LockedSemiSyncPrimaryHypothesis AnalysisCode = "LockedSemiSyncPrimaryHypothesis" LockedSemiSyncPrimary AnalysisCode = "LockedSemiSyncPrimary" - BinlogServerFailingToConnectToPrimary AnalysisCode = "BinlogServerFailingToConnectToPrimary" ErrantGTIDDetected AnalysisCode = "ErrantGTIDDetected" ) @@ -100,15 +99,11 @@ type ReplicationAnalysis struct { CountReplicas uint CountValidReplicas uint CountValidReplicatingReplicas uint - CountReplicasFailingToConnectToPrimary uint - ReplicationDepth uint - IsFailingToConnectToPrimary bool ReplicationStopped bool ErrantGTID string Analysis AnalysisCode Description string StructureAnalysis []StructureAnalysisCode - IsBinlogServer bool OracleGTIDImmediateTopology bool MariaDBGTIDImmediateTopology bool BinlogServerImmediateTopology bool diff --git a/go/vt/vtorc/inst/analysis_dao.go b/go/vt/vtorc/inst/analysis_dao.go index 7e9cef9c30b..a85fc02edcc 100644 --- a/go/vt/vtorc/inst/analysis_dao.go +++ b/go/vt/vtorc/inst/analysis_dao.go @@ -135,19 +135,10 @@ func GetReplicationAnalysis(keyspace string, shard string, hints *ReplicationAna ), 0 ) AS count_replicas_failing_to_connect_to_primary, - MIN(primary_instance.replication_depth) AS replication_depth, - MIN( - primary_instance.replica_sql_running = 1 - AND primary_instance.replica_io_running = 0 - AND primary_instance.last_io_error like '%%error %%connecting to master%%' - ) AS is_failing_to_connect_to_primary, MIN( primary_instance.replica_sql_running = 0 OR primary_instance.replica_io_running = 0 ) AS replication_stopped, - MIN( - primary_instance.binlog_server - ) AS is_binlog_server, MIN( primary_instance.supports_oracle_gtid ) AS supports_oracle_gtid, @@ -340,11 +331,7 @@ func GetReplicationAnalysis(keyspace string, shard string, hints *ReplicationAna a.CountReplicas = m.GetUint("count_replicas") a.CountValidReplicas = m.GetUint("count_valid_replicas") a.CountValidReplicatingReplicas = m.GetUint("count_valid_replicating_replicas") - a.CountReplicasFailingToConnectToPrimary = m.GetUint("count_replicas_failing_to_connect_to_primary") - a.ReplicationDepth = m.GetUint("replication_depth") - a.IsFailingToConnectToPrimary = m.GetBool("is_failing_to_connect_to_primary") a.ReplicationStopped = m.GetBool("replication_stopped") - a.IsBinlogServer = m.GetBool("is_binlog_server") a.ErrantGTID = m.GetString("gtid_errant") countValidOracleGTIDReplicas := m.GetUint("count_valid_oracle_gtid_replicas") @@ -377,8 +364,8 @@ func GetReplicationAnalysis(keyspace string, shard string, hints *ReplicationAna a.IsReadOnly = m.GetUint("read_only") == 1 if !a.LastCheckValid { - analysisMessage := fmt.Sprintf("analysis: Alias: %+v, Keyspace: %+v, Shard: %+v, IsPrimary: %+v, LastCheckValid: %+v, LastCheckPartialSuccess: %+v, CountReplicas: %+v, CountValidReplicas: %+v, CountValidReplicatingReplicas: %+v, CountLaggingReplicas: %+v, CountDelayedReplicas: %+v, CountReplicasFailingToConnectToPrimary: %+v", - a.AnalyzedInstanceAlias, a.ClusterDetails.Keyspace, a.ClusterDetails.Shard, a.IsPrimary, a.LastCheckValid, a.LastCheckPartialSuccess, a.CountReplicas, a.CountValidReplicas, a.CountValidReplicatingReplicas, a.CountLaggingReplicas, a.CountDelayedReplicas, a.CountReplicasFailingToConnectToPrimary, + analysisMessage := fmt.Sprintf("analysis: Alias: %+v, Keyspace: %+v, Shard: %+v, IsPrimary: %+v, LastCheckValid: %+v, LastCheckPartialSuccess: %+v, CountReplicas: %+v, CountValidReplicas: %+v, CountValidReplicatingReplicas: %+v, CountLaggingReplicas: %+v, CountDelayedReplicas: %+v", + a.AnalyzedInstanceAlias, a.ClusterDetails.Keyspace, a.ClusterDetails.Shard, a.IsPrimary, a.LastCheckValid, a.LastCheckPartialSuccess, a.CountReplicas, a.CountValidReplicas, a.CountValidReplicatingReplicas, a.CountLaggingReplicas, a.CountDelayedReplicas, ) if util.ClearToLog("analysis_dao", analysisMessage) { log.Infof(analysisMessage) @@ -507,11 +494,6 @@ func GetReplicationAnalysis(keyspace string, shard string, hints *ReplicationAna a.Analysis = UnreachablePrimary a.Description = "Primary cannot be reached by vtorc but it has replicating replicas; possibly a network/host issue" // - } else if a.IsPrimary && !a.LastCheckValid && a.LastCheckPartialSuccess && a.CountReplicasFailingToConnectToPrimary > 0 && a.CountValidReplicas > 0 && a.CountValidReplicatingReplicas > 0 { - // there's partial success, but also at least one replica is failing to connect to primary - a.Analysis = UnreachablePrimary - a.Description = "Primary cannot be reached by vtorc but it has replicating replicas; possibly a network/host issue" - // } else if a.IsPrimary && a.SemiSyncPrimaryEnabled && a.SemiSyncPrimaryStatus && a.SemiSyncPrimaryWaitForReplicaCount > 0 && a.SemiSyncPrimaryClients < a.SemiSyncPrimaryWaitForReplicaCount { if isStaleBinlogCoordinates { a.Analysis = LockedSemiSyncPrimary @@ -536,10 +518,6 @@ func GetReplicationAnalysis(keyspace string, shard string, hints *ReplicationAna a.Analysis = AllPrimaryReplicasNotReplicatingOrDead a.Description = "Primary is reachable but none of its replicas is replicating" // - } else if a.IsBinlogServer && a.IsFailingToConnectToPrimary { - a.Analysis = BinlogServerFailingToConnectToPrimary - a.Description = "Binlog server is unable to connect to its primary" - // } // else if a.IsPrimary && a.CountReplicas == 0 { // a.Analysis = PrimaryWithoutReplicas diff --git a/go/vt/vtorc/test/recovery_analysis.go b/go/vt/vtorc/test/recovery_analysis.go index b2ae4ce9520..92c531eceaf 100644 --- a/go/vt/vtorc/test/recovery_analysis.go +++ b/go/vt/vtorc/test/recovery_analysis.go @@ -54,15 +54,11 @@ type InfoForRecoveryAnalysis struct { CountReplicas uint CountValidReplicas uint CountValidReplicatingReplicas uint - CountReplicasFailingToConnectToPrimary uint CountDowntimedReplicas uint - ReplicationDepth uint - IsFailingToConnectToPrimary int ReplicationStopped int IsDowntimed int DowntimeEndTimestamp string DowntimeRemainingSeconds int - IsBinlogServer int CountValidOracleGTIDReplicas uint CountValidMariaDBGTIDReplicas uint CountValidBinlogServerReplicas uint @@ -100,7 +96,6 @@ func (info *InfoForRecoveryAnalysis) ConvertToRowMap() sqlutils.RowMap { rowMap["count_mixed_based_logging_replicas"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.CountMixedBasedLoggingReplicas), Valid: true} rowMap["count_oracle_gtid_replicas"] = sqlutils.CellData{Valid: false} rowMap["count_replicas"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.CountReplicas), Valid: true} - rowMap["count_replicas_failing_to_connect_to_primary"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.CountReplicasFailingToConnectToPrimary), Valid: true} rowMap["count_row_based_logging_replicas"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.CountRowBasedLoggingReplicas), Valid: true} rowMap["count_semi_sync_replicas"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.CountSemiSyncReplicasEnabled), Valid: true} rowMap["count_statement_based_logging_replicas"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.CountStatementBasedLoggingReplicas), Valid: true} @@ -116,10 +111,8 @@ func (info *InfoForRecoveryAnalysis) ConvertToRowMap() sqlutils.RowMap { rowMap["gtid_errant"] = sqlutils.CellData{String: info.ErrantGTID, Valid: true} rowMap["gtid_mode"] = sqlutils.CellData{String: info.GTIDMode, Valid: true} rowMap["hostname"] = sqlutils.CellData{String: info.Hostname, Valid: true} - rowMap["is_binlog_server"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.IsBinlogServer), Valid: true} rowMap["is_co_primary"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.IsCoPrimary), Valid: true} rowMap["is_downtimed"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.IsDowntimed), Valid: true} - rowMap["is_failing_to_connect_to_primary"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.IsFailingToConnectToPrimary), Valid: true} rowMap["is_invalid"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.IsInvalid), Valid: true} rowMap["is_last_check_valid"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.LastCheckValid), Valid: true} rowMap["is_primary"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.IsPrimary), Valid: true} @@ -143,7 +136,6 @@ func (info *InfoForRecoveryAnalysis) ConvertToRowMap() sqlutils.RowMap { rowMap["primary_timestamp"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.PrimaryTimestamp), Valid: true} rowMap["read_only"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.ReadOnly), Valid: true} rowMap["region"] = sqlutils.CellData{String: info.Region, Valid: true} - rowMap["replication_depth"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.ReplicationDepth), Valid: true} rowMap["replication_stopped"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.ReplicationStopped), Valid: true} rowMap["semi_sync_primary_clients"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.SemiSyncPrimaryClients), Valid: true} rowMap["semi_sync_primary_enabled"] = sqlutils.CellData{String: fmt.Sprintf("%v", info.SemiSyncPrimaryEnabled), Valid: true}