mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-10653: Fix segfault in SHOW MASTER STATUS with NULL inuse_relaylog
The previous patch for MDEV-10653 changes the rpl_parallel::workers_idle() function to use Relay_log_info::last_inuse_relaylog to check for idle workers. But the code was missing a NULL check. Also, there was one place during SQL slave thread start which was missing mutex synchronisation when updating inuse_relaylog. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
@ -2538,7 +2538,9 @@ rpl_parallel::stop_during_until()
|
||||
bool
|
||||
rpl_parallel::workers_idle(Relay_log_info *rli)
|
||||
{
|
||||
return rli->last_inuse_relaylog->queued_count ==
|
||||
mysql_mutex_assert_owner(&rli->data_lock);
|
||||
return !rli->last_inuse_relaylog ||
|
||||
rli->last_inuse_relaylog->queued_count ==
|
||||
rli->last_inuse_relaylog->dequeued_count;
|
||||
}
|
||||
|
||||
|
@ -5369,19 +5369,25 @@ pthread_handler_t handle_slave_sql(void *arg)
|
||||
}
|
||||
else
|
||||
rli->gtid_skip_flag = GTID_SKIP_NOT;
|
||||
mysql_mutex_lock(&rli->data_lock);
|
||||
if (init_relay_log_pos(rli,
|
||||
rli->group_relay_log_name,
|
||||
rli->group_relay_log_pos,
|
||||
1 /*need data lock*/, &errmsg,
|
||||
0 /*need data lock*/, &errmsg,
|
||||
1 /*look for a description_event*/))
|
||||
{
|
||||
rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, NULL,
|
||||
"Error initializing relay log position: %s", errmsg);
|
||||
mysql_mutex_unlock(&rli->data_lock);
|
||||
goto err_before_start;
|
||||
}
|
||||
rli->reset_inuse_relaylog();
|
||||
if (rli->alloc_inuse_relaylog(rli->group_relay_log_name))
|
||||
{
|
||||
mysql_mutex_unlock(&rli->data_lock);
|
||||
goto err_before_start;
|
||||
}
|
||||
mysql_mutex_unlock(&rli->data_lock);
|
||||
|
||||
strcpy(rli->future_event_master_log_name, rli->group_master_log_name);
|
||||
THD_CHECK_SENTRY(thd);
|
||||
|
Reference in New Issue
Block a user