diff options
author | Monty <monty@mariadb.org> | 2016-01-03 13:27:59 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2016-01-03 13:27:59 +0200 |
commit | 8fcc0bfefadcb4e9f7acb13d11661daeea5097f9 (patch) | |
tree | 4863ff0cd610e325e29ce48cfa36dc954c8d046f /sql/slave.cc | |
parent | 661a6d89065390ca1e9b4be05219b75f850ed290 (diff) | |
download | mariadb-git-8fcc0bfefadcb4e9f7acb13d11661daeea5097f9.tar.gz |
Fixed bug in semi_sync replication tests.
The problem was that wait_for_slave_io_to_start reported that the io thread
was ready, when it was still initializing. This caused test suite to
continue too early, for example before the semi sync plugin was properly
enabled.
Fixed by introducing a new internal stage: "Preparing". Slave_IO_Running is
now set to "Yes" only when all initializing is done and the IO thread is
ready to read things from the master.
The only test affected by this change is rpl_flsh_tbls, which got stuck in
the preparing phase while trying to read the GTID position from a table.
Fixed by having this test waiting for Preparing instead of Yes.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 6b2a88a2953..7474aec38ca 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2615,6 +2615,8 @@ static bool send_show_master_info_header(THD *thd, bool full, DBUG_RETURN(FALSE); } +/* Text for Slave_IO_Running */ +static const char *slave_running[]= { "No", "Connecting", "Preparing", "Yes" }; static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full, String *gtid_pos) @@ -2668,9 +2670,7 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full, &my_charset_bin); protocol->store((ulonglong) mi->rli.group_relay_log_pos); protocol->store(mi->rli.group_master_log_name, &my_charset_bin); - protocol->store(mi->slave_running == MYSQL_SLAVE_RUN_CONNECT ? - "Yes" : (mi->slave_running == MYSQL_SLAVE_RUN_NOT_CONNECT ? - "Connecting" : "No"), &my_charset_bin); + protocol->store(slave_running[mi->slave_running], &my_charset_bin); protocol->store(mi->rli.slave_running ? "Yes":"No", &my_charset_bin); protocol->store(rpl_filter->get_do_db()); protocol->store(rpl_filter->get_ignore_db()); @@ -2713,7 +2713,7 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full, Seconds_Behind_Master: if SQL thread is running and I/O thread is connected, we can compute it otherwise show NULL (i.e. unknown). */ - if ((mi->slave_running == MYSQL_SLAVE_RUN_CONNECT) && + if ((mi->slave_running == MYSQL_SLAVE_RUN_READING) && mi->rli.slave_running) { long time_diff; |