Hi Zhenxing,
Your patch seems to fix the bug.
I have one question though:
1. Can this change be harmful for some tests that rely on:
include/wait_for_slave_io_to_stop.inc;
The reason I ask, is that the wait condition for the slave thread
to stop is:
let $slave_param_value= No;
Now, if one is testing some master crash and then uses the
slave_param_value= No to check that the IO thread is indeed stopped (for
whatever reason), then this might never be true and we get a test
timeout => wait forever.
I am not saying that using the include/wait_for_slave_io_to_stop.inc;
is appropriate for tests that test master crashes and also slave IO
thread issues, but still, this might be dubious for test writers.
Basically, your patch is very much correct, I am just wondering if we
should also document/warn about this so that test writers are more
careful when correlating master crashes with slave io thread status.
This came into my mind, when looking at the test case for verifying the
bug. Note that with this bug fix, the instruction:
# wait for slave I/O to stop
source include/wait_for_slave_io_to_stop.inc;
may never complete.
On Fri, 2008-12-26 at 16:47 +0800, He Zhenxing wrote:
> #At file:///media/sdb2/hezx/work/mysql/bzrwork/b41613/5.1-rpl/
>
> 2708 He Zhenxing 2008-12-26
> BUG#41613 Slave I/O status inconsistent between SHOW SLAVE STATUS and START
> SLAVE
>
> There are three internal status for slave I/O thread, both
> MYSQL_SLAVE_RUN_NOT_CONNECT and MYSQL_SLAVE_NOT_RUN are reported
> as 'No' for Slave_IO_running of command SHOW SLAVE STATUS.
>
> Change MYSQL_SLAVE_RUN_NOT_CONNECT to be reported as 'Connecting'.
> modified:
> sql/slave.cc
>
> per-file messages:
> sql/slave.cc
> Report 'Connecting' when slave I/O thread is running but not connected
> === modified file 'sql/slave.cc'
> --- a/sql/slave.cc 2008-11-28 11:38:49 +0000
> +++ b/sql/slave.cc 2008-12-26 08:47:03 +0000
> @@ -1457,7 +1457,8 @@ bool show_master_info(THD* thd, Master_i
> 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" : "No", &my_charset_bin);
> + "Yes" : (mi->slave_running == MYSQL_SLAVE_RUN_NOT_CONNECT ?
> + "Connecting" : "No"), &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());
>
>
--
Luís