Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ func (cluster *Cluster) CompareSchemaBetweenMasterAndSlave(sl *ServerMonitor) ([
}
}

for tblname, _ := range slTables {
for tblname := range slTables {
_, ok := masterTables[tblname]
if !ok {
if cluster.IsInSchemaIgnore(tblname) {
Expand Down Expand Up @@ -1959,15 +1959,25 @@ func (cluster *Cluster) MonitorQueryRules() {
var myRule config.QueryRule
if clrule, ok := cluster.QueryRules[rule.Id]; ok {
myRule = clrule
duplicates := strings.Split(clrule.Proxies, ",")

// Handle existing proxies list
var proxyIds []string
if clrule.Proxies != "" {
proxyIds = strings.Split(clrule.Proxies, ",")
}

// Check if current proxy already tracked
found := false
for _, prxid := range duplicates {
for _, prxid := range proxyIds {
if prx.Id == prxid {
found = true
break
}
}

if !found {
duplicates = append(duplicates, prx.Id)
proxyIds = append(proxyIds, prx.Id)
myRule.Proxies = strings.Join(proxyIds, ",")
}
} else {
myRule.Id = rule.Id
Expand Down
Loading