Replaced SELECT 1 with DO 1 to route traffic to hostgroup 0 (writer)

pull/4024/head
Rahim Kanji 4 years ago
parent 3ba94cd20b
commit 2e7703e2db

@ -183,7 +183,7 @@ int main(int argc, char** argv) {
STEP_END,
STEP_START
UPDATE_PREV_METRICS(proxysql_admin),
LOOP_FUNC(EXECUTE_QUERY("SELECT 1", proxysql, true), 2),
LOOP_FUNC(EXECUTE_QUERY("DO 1", proxysql, true), 2),
DELAY_SEC(2),
UPDATE_AFTER_METRICS(proxysql_admin),
CHECK_RESULT(std::equal_to<double>, "proxysql_mysql_monitor_dns_cache_record_updated"),
@ -192,7 +192,7 @@ int main(int argc, char** argv) {
STEP_END,
STEP_START
UPDATE_PREV_METRICS(proxysql_admin),
LOOP_FUNC(EXECUTE_QUERY("SELECT 1", proxysql, true), 2),
LOOP_FUNC(EXECUTE_QUERY("DO 1", proxysql, true), 2),
DELAY_SEC(2),
UPDATE_AFTER_METRICS(proxysql_admin),
CHECK_RESULT(std::equal_to<double>, "proxysql_mysql_monitor_dns_cache_record_updated"),
@ -204,7 +204,8 @@ int main(int argc, char** argv) {
EXECUTE_QUERY("INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,max_connections,comment) VALUES (0,'google.com',7861,0,1000,'dummy entry')", proxysql_admin, false),
EXECUTE_QUERY("LOAD MYSQL SERVERS TO RUNTIME", proxysql_admin, false),
DELAY_SEC(2),
LOOP_FUNC(EXECUTE_QUERY("SELECT 1", proxysql, true), 2),
LOOP_FUNC(EXECUTE_QUERY("DO 1", proxysql, true), 2),
DELAY_SEC(2),
UPDATE_AFTER_METRICS(proxysql_admin),
CHECK_RESULT(std::greater<double>, "proxysql_mysql_monitor_dns_cache_record_updated"),
CHECK_RESULT(std::greater<double>, "proxysql_mysql_monitor_dns_cache_lookup_success"),
@ -215,7 +216,8 @@ int main(int argc, char** argv) {
EXECUTE_QUERY("INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,max_connections,comment) VALUES (0,' yahoo.com ',7861,0,1000,'dummy entry')", proxysql_admin, false),
EXECUTE_QUERY("LOAD MYSQL SERVERS TO RUNTIME", proxysql_admin, false),
DELAY_SEC(2),
LOOP_FUNC(EXECUTE_QUERY("SELECT 1", proxysql, true), 2),
LOOP_FUNC(EXECUTE_QUERY("DO 1", proxysql, true), 2),
DELAY_SEC(2),
UPDATE_AFTER_METRICS(proxysql_admin),
CHECK_RESULT(std::greater<double>, "proxysql_mysql_monitor_dns_cache_record_updated"),
CHECK_RESULT(std::greater<double>, "proxysql_mysql_monitor_dns_cache_lookup_success"),
@ -236,7 +238,8 @@ int main(int argc, char** argv) {
EXECUTE_QUERY("INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,max_connections,comment) VALUES (0,'INVALID_DOMAIN',7861,0,1000,'dummy entry')", proxysql_admin, false),
EXECUTE_QUERY("LOAD MYSQL SERVERS TO RUNTIME", proxysql_admin, false),
DELAY_SEC(2),
LOOP_FUNC(EXECUTE_QUERY("SELECT 1", proxysql, true), 2),
LOOP_FUNC(EXECUTE_QUERY("DO 1", proxysql, true), 2),
DELAY_SEC(2),
UPDATE_AFTER_METRICS(proxysql_admin),
CHECK_RESULT(std::equal_to<double>, "proxysql_mysql_monitor_dns_cache_record_updated"),
CHECK_RESULT(std::equal_to<double>, "proxysql_mysql_monitor_dns_cache_lookup_success"),
@ -248,7 +251,8 @@ int main(int argc, char** argv) {
EXECUTE_QUERY("LOAD MYSQL VARIABLES TO RUNTIME", proxysql_admin, false),
DELAY_SEC(2),
UPDATE_PREV_METRICS(proxysql_admin),
LOOP_FUNC(EXECUTE_QUERY("SELECT 1", proxysql, true), 2),
LOOP_FUNC(EXECUTE_QUERY("DO 1", proxysql, true), 2),
DELAY_SEC(2),
UPDATE_AFTER_METRICS(proxysql_admin),
CHECK_RESULT(std::equal_to<double>, "proxysql_mysql_monitor_dns_cache_record_updated"),
CHECK_RESULT(std::equal_to<double>, "proxysql_mysql_monitor_dns_cache_lookup_success"),

Loading…
Cancel
Save