cleanup: use THD_STAGE_INFO, not thd_proc_info

and put master-slave.inc *last* in the series of includes
This commit is contained in:
Sergei Golubchik 2024-04-24 22:08:52 +02:00
parent cb7c99674e
commit cea083af9f
4 changed files with 3 additions and 10 deletions

View file

@ -1,9 +1,9 @@
# #
# Ensure that Seconds_Behind_Master works correctly on the parallel replica. # Ensure that Seconds_Behind_Master works correctly on the parallel replica.
# #
--source include/master-slave.inc
--source include/have_log_bin.inc --source include/have_log_bin.inc
--source include/have_debug.inc --source include/have_debug.inc
--source include/master-slave.inc
--echo # --echo #
--echo # MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel Replicas --echo # MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel Replicas

View file

@ -44,8 +44,6 @@ rpl_slave_state *rpl_global_gtid_slave_state;
/* Object used for MASTER_GTID_WAIT(). */ /* Object used for MASTER_GTID_WAIT(). */
gtid_waiting rpl_global_gtid_waiting; gtid_waiting rpl_global_gtid_waiting;
const char *const Relay_log_info::state_delaying_string = "Waiting until MASTER_DELAY seconds after master executed event";
Relay_log_info::Relay_log_info(bool is_slave_recovery, const char* thread_name) Relay_log_info::Relay_log_info(bool is_slave_recovery, const char* thread_name)
:Slave_reporting_capability(thread_name), :Slave_reporting_capability(thread_name),
replicate_same_server_id(::replicate_same_server_id), replicate_same_server_id(::replicate_same_server_id),

View file

@ -506,11 +506,6 @@ public:
m_flags&= ~flag; m_flags&= ~flag;
} }
/**
Text used in THD::proc_info when the slave SQL thread is delaying.
*/
static const char *const state_delaying_string;
bool flush(); bool flush();
/** /**
@ -533,7 +528,7 @@ public:
{ {
mysql_mutex_assert_owner(&data_lock); mysql_mutex_assert_owner(&data_lock);
sql_delay_end= delay_end; sql_delay_end= delay_end;
thd_proc_info(sql_driver_thd, state_delaying_string); THD_STAGE_INFO(sql_driver_thd, stage_sql_thd_waiting_until_delay);
} }
int32 get_sql_delay() { return sql_delay; } int32 get_sql_delay() { return sql_delay; }

View file

@ -3324,7 +3324,7 @@ static bool send_show_master_info_data(THD *thd, Master_info *mi, bool full,
// to ensure that we use the same value throughout this function. // to ensure that we use the same value throughout this function.
const char *slave_sql_running_state= const char *slave_sql_running_state=
mi->rli.sql_driver_thd ? mi->rli.sql_driver_thd->proc_info : ""; mi->rli.sql_driver_thd ? mi->rli.sql_driver_thd->proc_info : "";
if (slave_sql_running_state == Relay_log_info::state_delaying_string) if (slave_sql_running_state == stage_sql_thd_waiting_until_delay.m_name)
{ {
time_t t= my_time(0), sql_delay_end= mi->rli.get_sql_delay_end(); time_t t= my_time(0), sql_delay_end= mi->rli.get_sql_delay_end();
protocol->store((uint32)(t < sql_delay_end ? sql_delay_end - t : 0)); protocol->store((uint32)(t < sql_delay_end ? sql_delay_end - t : 0));