From 9954e6b4cb0a24c50fa44b9ff2d622b9560f7ec4 Mon Sep 17 00:00:00 2001 From: Valentin Rakush Date: Thu, 21 Nov 2019 06:46:43 +0000 Subject: [PATCH] SELECT CONFIG TO: adding new columns to export (add_lag_ms, min_lag_ms, lag_num_checks) --- lib/ProxySQL_Admin.cpp | 5 ++++- test/tap/tests/proxysql_reference_select_config_file.cnf | 5 +++++ test/tap/tests/select_config_file-t.cpp | 5 +++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index a75084c73..f687abd6e 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -10599,7 +10599,10 @@ int ProxySQL_Admin::Write_MySQL_Servers_to_configfile(std::string& data) { addField(data, "check_timeout_ms", r->fields[7], ""); addField(data, "writer_is_also_reader", r->fields[8], ""); addField(data, "new_reader_weight", r->fields[9], ""); - addField(data, "comment", r->fields[10]); + addField(data, "add_lag_ms", r->fields[10], ""); + addField(data, "min_lag_ms", r->fields[11], ""); + addField(data, "lag_num_checks", r->fields[12], ""); + addField(data, "comment", r->fields[13]); data += "\t}"; isNext = true; diff --git a/test/tap/tests/proxysql_reference_select_config_file.cnf b/test/tap/tests/proxysql_reference_select_config_file.cnf index 3a8a1a3cb..7c79bc9be 100644 --- a/test/tap/tests/proxysql_reference_select_config_file.cnf +++ b/test/tap/tests/proxysql_reference_select_config_file.cnf @@ -54,6 +54,7 @@ admin_variables = stats_mysql_connection_pool="admin" stats_mysql_connections="admin" stats_mysql_query_cache="admin" + stats_mysql_query_digest_to_disk="admin" stats_system_cpu="admin" stats_system_memory="admin" telnet_admin_ifaces="admin" @@ -139,6 +140,7 @@ mysql_variables = monitor_groupreplication_healthcheck_interval="mysql" monitor_groupreplication_healthcheck_max_timeout_count="mysql" monitor_groupreplication_healthcheck_timeout="mysql" + monitor_groupreplication_max_transactions_behind_count="mysql" monitor_history="mysql" monitor_password="mysql" monitor_ping_interval="mysql" @@ -330,6 +332,9 @@ mysql_aws_aurora_hostgroups: check_timeout_ms=107 writer_is_also_reader=1 new_reader_weight=9 + add_lag_ms=10 + min_lag_ms=20 + lag_num_checks=1 comment="comment" } ) diff --git a/test/tap/tests/select_config_file-t.cpp b/test/tap/tests/select_config_file-t.cpp index 6850cd737..6ec977a73 100644 --- a/test/tap/tests/select_config_file-t.cpp +++ b/test/tap/tests/select_config_file-t.cpp @@ -96,8 +96,9 @@ int main(int argc, char** argv) { MYSQL_QUERY(mysql, "insert into scheduler (id, active, interval_ms, filename, arg1, arg2, arg3, arg4, arg5, comment) values " " (1,1,1000,'filename','a1','a2','a3','a4','a5','comment');"); MYSQL_QUERY(mysql, "insert into mysql_aws_aurora_hostgroups (writer_hostgroup, reader_hostgroup, active, aurora_port, " - " domain_name, max_lag_ms, check_interval_ms, check_timeout_ms, writer_is_also_reader, new_reader_weight, comment) " - " values (1,2,1,3,'.domain.net',20,106,107,1,9,'comment');"); + " domain_name, max_lag_ms, check_interval_ms, check_timeout_ms, writer_is_also_reader, new_reader_weight, " + " add_lag_ms, min_lag_ms, lag_num_checks, comment) " + " values (1,2,1,3,'.domain.net',20,106,107,1,9,10,20,1,'comment');"); MYSQL_QUERY(mysql, "insert into mysql_galera_hostgroups (writer_hostgroup, backup_writer_hostgroup, reader_hostgroup, offline_hostgroup, " " active, max_writers, writer_is_also_reader, max_transactions_behind, comment) values (1,2,3,4,1,23,1,1,'comment');"); MYSQL_QUERY(mysql, "insert into mysql_group_replication_hostgroups (writer_hostgroup, backup_writer_hostgroup, reader_hostgroup, offline_hostgroup, "