Skip to content

Commit 3f7a3a8

Browse files
Merge pull request #12 from satya-bodapati/replace-fix
DISTMYSQL-243 - Orchestrator uses inefficient subquery in REPLACE to …
2 parents 22cfcd4 + 58b0bf9 commit 3f7a3a8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

go/inst/cluster_alias_dao.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,15 @@ func UpdateClusterAliases() error {
126126
left join database_instance_downtime using (hostname, port)
127127
where
128128
suggested_cluster_alias!=''
129+
and cluster_name != ''
129130
/* exclude newly demoted, downtimed masters */
130131
and ifnull(
131132
database_instance_downtime.downtime_active = 1
132133
and database_instance_downtime.end_timestamp > now()
133134
and database_instance_downtime.reason = ?
134135
, 0) = 0
135-
order by
136-
ifnull(last_checked <= last_seen, 0) asc,
137-
read_only desc,
138-
num_slave_hosts asc
136+
group by
137+
suggested_cluster_alias, cluster_name
139138
`, DowntimeLostInRecoveryMessage)
140139
return log.Errore(err)
141140
}

0 commit comments

Comments
 (0)