Commit f458b40f authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-22827 InnoDB: Failing assertion: purge_sys->n_stop == 0

When MDEV-22769 introduced srv_shutdown_state=SRV_SHUTDOWN_INITIATED in
commit efc70da5
we forgot to adjust a few checks for SRV_SHUTDOWN_NONE.

In the initial shutdown step, we are waiting for the background
DROP TABLE queue to be processed or discarded. At that time,
some background tasks (such as buffer pool resizing or dumping
or encryption key rotation) may be terminated, but others must
remain running normally.

srv_purge_coordinator_suspend(), srv_purge_coordinator_thread(),
srv_start_wait_for_purge_to_start(): Treat SRV_SHUTDOWN_NONE
and SRV_SHUTDOWN_INITIATED equally.
parent e9dbbf11
......@@ -2780,7 +2780,7 @@ srv_purge_coordinator_suspend(
rw_lock_x_lock(&purge_sys->latch);
stop = (srv_shutdown_state == SRV_SHUTDOWN_NONE
stop = (srv_shutdown_state <= SRV_SHUTDOWN_INITIATED
&& purge_sys->state == PURGE_STATE_STOP);
if (!stop) {
......@@ -2856,7 +2856,7 @@ DECLARE_THREAD(srv_purge_coordinator_thread)(
/* If there are no records to purge or the last
purge didn't purge any records then wait for activity. */
if (srv_shutdown_state == SRV_SHUTDOWN_NONE
if (srv_shutdown_state <= SRV_SHUTDOWN_INITIATED
&& srv_undo_sources
&& (purge_sys->state == PURGE_STATE_STOP
|| n_total_purged == 0)) {
......
......@@ -1092,7 +1092,7 @@ srv_start_wait_for_purge_to_start()
ut_a(state != PURGE_STATE_DISABLED);
while (srv_shutdown_state == SRV_SHUTDOWN_NONE
while (srv_shutdown_state <= SRV_SHUTDOWN_INITIATED
&& srv_force_recovery < SRV_FORCE_NO_BACKGROUND
&& state == PURGE_STATE_INIT) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment