@@ -442,7 +442,7 @@ func (cluster *Cluster) IsEqualBinlogFilters(m *ServerMonitor, s *ServerMonitor)
442
442
443
443
func (cluster * Cluster ) IsEqualReplicationFilters (m * ServerMonitor , s * ServerMonitor ) bool {
444
444
445
- if m .Variables [ "REPLICATE_DO_TABLE" ] == s .Variables [ "REPLICATE_DO_TABLE" ] && m .Variables [ "REPLICATE_IGNORE_TABLE" ] == s .Variables [ "REPLICATE_IGNORE_TABLE" ] && m .Variables [ "REPLICATE_WILD_DO_TABLE" ] == s .Variables [ "REPLICATE_WILD_DO_TABLE" ] && m .Variables [ "REPLICATE_WILD_IGNORE_TABLE" ] == s .Variables [ "REPLICATE_WILD_IGNORE_TABLE" ] && m .Variables [ "REPLICATE_DO_DB" ] == s .Variables [ "REPLICATE_DO_DB" ] && m .Variables [ "REPLICATE_IGNORE_DB" ] == s .Variables [ "REPLICATE_IGNORE_DB" ] {
445
+ if m .Variables . Get ( "REPLICATE_DO_TABLE" ) == s .Variables . Get ( "REPLICATE_DO_TABLE" ) && m .Variables . Get ( "REPLICATE_IGNORE_TABLE" ) == s .Variables . Get ( "REPLICATE_IGNORE_TABLE" ) && m .Variables . Get ( "REPLICATE_WILD_DO_TABLE" ) == s .Variables . Get ( "REPLICATE_WILD_DO_TABLE" ) && m .Variables . Get ( "REPLICATE_WILD_IGNORE_TABLE" ) == s .Variables . Get ( "REPLICATE_WILD_IGNORE_TABLE" ) && m .Variables . Get ( "REPLICATE_DO_DB" ) == s .Variables . Get ( "REPLICATE_DO_DB" ) && m .Variables . Get ( "REPLICATE_IGNORE_DB" ) == s .Variables . Get ( "REPLICATE_IGNORE_DB" ) {
446
446
return true
447
447
} else {
448
448
return false
@@ -451,8 +451,8 @@ func (cluster *Cluster) IsEqualReplicationFilters(m *ServerMonitor, s *ServerMon
451
451
452
452
func (cluster * Cluster ) IsCurrentGTIDSync (m * ServerMonitor , s * ServerMonitor ) bool {
453
453
454
- sGtid := s .Variables [ "GTID_CURRENT_POS" ]
455
- mGtid := m .Variables [ "GTID_CURRENT_POS" ]
454
+ sGtid := s .Variables . Get ( "GTID_CURRENT_POS" )
455
+ mGtid := m .Variables . Get ( "GTID_CURRENT_POS" )
456
456
if sGtid == mGtid {
457
457
return true
458
458
} else {
@@ -547,9 +547,9 @@ func (cluster *Cluster) CheckTableChecksum(schema string, table string) {
547
547
pk , _ := cluster .master .GetTablePK (schema , table )
548
548
if pk == "" {
549
549
cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModGeneral , config .LvlErr , "Checksum, no primary key for table %s.%s" , schema , table )
550
- t := cluster .master .DictTables [ schema + "." + table ]
550
+ t := cluster .master .DictTables . Get ( schema + "." + table )
551
551
t .TableSync = "NA"
552
- cluster .master .DictTables [ schema + "." + table ] = t
552
+ cluster .master .DictTables . Set ( schema + "." + table , t )
553
553
return
554
554
}
555
555
if strings .Contains (pk , "," ) {
@@ -655,17 +655,17 @@ func (cluster *Cluster) CheckTableChecksum(schema string, table string) {
655
655
if chunk .ChunkCheckSum != slaveChecksums [chunk .ChunkId ].ChunkCheckSum {
656
656
checkok = false
657
657
cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModGeneral , config .LvlInfo , "Checksum table failed chunk(%s,%s) %s.%s %s" , chunk .ChunkMinKey , chunk .ChunkMaxKey , schema , table , s .URL )
658
- t := cluster .master .DictTables [ schema + "." + table ]
658
+ t := cluster .master .DictTables . Get ( schema + "." + table )
659
659
t .TableSync = "ER"
660
- cluster .master .DictTables [ schema + "." + table ] = t
660
+ cluster .master .DictTables . Set ( schema + "." + table , t )
661
661
}
662
662
663
663
}
664
664
if checkok {
665
665
cluster .LogModulePrintf (cluster .Conf .Verbose , config .ConstLogModGeneral , config .LvlInfo , "Checksum table succeed %s.%s %s" , schema , table , s .URL )
666
- t := cluster .master .DictTables [ schema + "." + table ]
666
+ t := cluster .master .DictTables . Get ( schema + "." + table )
667
667
t .TableSync = "OK"
668
- cluster .master .DictTables [ schema + "." + table ] = t
668
+ cluster .master .DictTables . Set ( schema + "." + table , t )
669
669
}
670
670
}
671
671
}
@@ -700,8 +700,8 @@ func (cluster *Cluster) IsSameWsrepUUID() bool {
700
700
if sothers .IsFailed () || s .URL == sothers .URL {
701
701
continue
702
702
}
703
- if s .Status [ "WSREP_CLUSTER_STATE_UUID" ] != sothers .Status [ "WSREP_CLUSTER_STATE_UUID" ] {
704
- cluster .SetState ("ERR00083" , state.State {ErrType : config .LvlWarn , ErrDesc : fmt .Sprintf (clusterError ["ERR00083" ], s .URL , s .Status [ "WSREP_CLUSTER_STATE_UUID" ] , sothers .URL , sothers .Status [ "WSREP_CLUSTER_STATE_UUID" ] ), ErrFrom : "MON" , ServerUrl : s .URL })
703
+ if s .Status . Get ( "WSREP_CLUSTER_STATE_UUID" ) != sothers .Status . Get ( "WSREP_CLUSTER_STATE_UUID" ) {
704
+ cluster .SetState ("ERR00083" , state.State {ErrType : config .LvlWarn , ErrDesc : fmt .Sprintf (clusterError ["ERR00083" ], s .URL , s .Status . Get ( "WSREP_CLUSTER_STATE_UUID" ) , sothers .URL , sothers .Status . Get ( "WSREP_CLUSTER_STATE_UUID" ) ), ErrFrom : "MON" , ServerUrl : s .URL })
705
705
return false
706
706
}
707
707
}
@@ -725,7 +725,7 @@ func (cluster *Cluster) IsNotHavingMySQLErrantTransaction() bool {
725
725
continue
726
726
}
727
727
728
- hasErrantTrx , _ , _ := dbhelper .HaveErrantTransactions (s .Conn , cluster .master .Variables [ "GTID_EXECUTED" ] , s .Variables [ "GTID_EXECUTED" ] )
728
+ hasErrantTrx , _ , _ := dbhelper .HaveErrantTransactions (s .Conn , cluster .master .Variables . Get ( "GTID_EXECUTED" ) , s .Variables . Get ( "GTID_EXECUTED" ) )
729
729
if hasErrantTrx {
730
730
cluster .SetState ("WARN0091" , state.State {ErrType : config .LvlWarn , ErrDesc : fmt .Sprintf (clusterError ["WARN0091" ], s .URL ), ErrFrom : "MON" , ServerUrl : s .URL })
731
731
return false
0 commit comments