1
0
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:
Kristian Nielsen
2023-12-17 18:35:14 +01:00
parent 1cbba45e6e
commit eaa4968fc5
2 changed files with 11 additions and 3 deletions

View File

@ -2538,8 +2538,10 @@ rpl_parallel::stop_during_until()
bool
rpl_parallel::workers_idle(Relay_log_info *rli)
{
return rli->last_inuse_relaylog->queued_count ==
rli->last_inuse_relaylog->dequeued_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;
}