Skip to content

Commit a80e710

Browse files
Filter out hosts that are OFFLINE_SOFT or OFFLINE_HARD
If a user wants to gracefully remove a host from proxysql, it will change the status to OFFLINE_SOFT, wait it to complete all the current ongoing connections and then change it to OFFLINE_HARD. The scheduler should not consider those hosts as available to be used and filter them out. Fixes: #25
1 parent b1c14a8 commit a80e710

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/proxysql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl ProxySQL {
3939
.expect("Failed to create ProxySQL connection");
4040

4141
let query = format!(
42-
"SELECT hostname, port, status, comment FROM mysql_servers WHERE hostgroup_id = {}",
42+
"SELECT hostname, port, status, comment FROM mysql_servers WHERE hostgroup_id = {} AND status IN ('ONLINE', 'SHUNNED')",
4343
config.readyset_hostgroup
4444
);
4545
let results: Vec<(String, u16, String, String)> = conn.query(query).unwrap();

0 commit comments

Comments
 (0)