Skip to content

Commit

Permalink
cleanup: use THD_STAGE_INFO, not thd_proc_info
Browse files Browse the repository at this point in the history
and put master-slave.inc *last* in the series of includes
  • Loading branch information
vuvova committed May 5, 2024
1 parent cb7c996 commit cea083a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion mysql-test/suite/rpl/t/rpl_parallel_sbm.test
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# 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_debug.inc
--source include/master-slave.inc

--echo #
--echo # MDEV-29639: Seconds_Behind_Master is incorrect for Delayed, Parallel Replicas
Expand Down
2 changes: 0 additions & 2 deletions sql/rpl_rli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ rpl_slave_state *rpl_global_gtid_slave_state;
/* Object used for MASTER_GTID_WAIT(). */
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)
:Slave_reporting_capability(thread_name),
replicate_same_server_id(::replicate_same_server_id),
Expand Down
7 changes: 1 addition & 6 deletions sql/rpl_rli.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,6 @@ class Relay_log_info : public Slave_reporting_capability
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();

/**
Expand All @@ -533,7 +528,7 @@ class Relay_log_info : public Slave_reporting_capability
{
mysql_mutex_assert_owner(&data_lock);
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; }
Expand Down
2 changes: 1 addition & 1 deletion sql/slave.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
const char *slave_sql_running_state=
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();
protocol->store((uint32)(t < sql_delay_end ? sql_delay_end - t : 0));
Expand Down

0 comments on commit cea083a

Please sign in to comment.