Skip to content

Commit

Permalink
Merge pull request #166 from github/meiji163/debug
Browse files Browse the repository at this point in the history
Set IgnoreHostsThreshold in ClusterProbe
  • Loading branch information
meiji163 authored Apr 9, 2024
2 parents e92dc89 + 2114df5 commit d89b112
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion pkg/mysql/mysql_http_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func MySQLHttpCheckHashKey(clusterName string, key *InstanceKey) string {
}

func CheckHttp(clusterName string, probe *Probe) (httpCheckResult *MySQLHttpCheck) {

if probe.HttpCheckPort <= 0 {
go func() { metrics.GetOrRegisterCounter("httpcheck.skip", nil).Inc(1) }()
return NewMySQLHttpCheck(clusterName, &probe.Key, http.StatusOK)
Expand Down
14 changes: 8 additions & 6 deletions pkg/throttle/throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,10 @@ func (throttler *Throttler) refreshMySQLInventory() error {
}
log.Debugf("Read %+v hosts from ProxySQL %s, hostgroup id: %d (%s)", len(servers), dsn, clusterSettings.ProxySQLSettings.HostgroupID, clusterName)
clusterProbes := &mysql.ClusterProbes{
ClusterName: clusterName,
IgnoreHostsCount: clusterSettings.IgnoreHostsCount,
InstanceProbes: mysql.NewProbes(),
ClusterName: clusterName,
IgnoreHostsCount: clusterSettings.IgnoreHostsCount,
IgnoreHostsThreshold: clusterSettings.IgnoreHostsThreshold,
InstanceProbes: mysql.NewProbes(),
}
for _, server := range servers {
key := mysql.InstanceKey{Hostname: server.Host, Port: int(server.Port)}
Expand All @@ -389,9 +390,10 @@ func (throttler *Throttler) refreshMySQLInventory() error {
keyspace, shard, strings.Join(vitess.ParseCells(clusterSettings.VitessSettings), ","),
)
clusterProbes := &mysql.ClusterProbes{
ClusterName: clusterName,
IgnoreHostsCount: clusterSettings.IgnoreHostsCount,
InstanceProbes: mysql.NewProbes(),
ClusterName: clusterName,
IgnoreHostsCount: clusterSettings.IgnoreHostsCount,
IgnoreHostsThreshold: clusterSettings.IgnoreHostsThreshold,
InstanceProbes: mysql.NewProbes(),
}
for _, tablet := range tablets {
key := mysql.InstanceKey{Hostname: tablet.MysqlHostname, Port: int(tablet.MysqlPort)}
Expand Down

0 comments on commit d89b112

Please sign in to comment.