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

When MDEV-22769 introduced srv_shutdown_state=SRV_SHUTDOWN_INITIATED in
commit efc70da5fd0459ff44153529d13651741cc32bc4
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.
This commit is contained in:
Marko Mäkelä 2020-06-08 10:28:34 +03:00
parent e9dbbf1120
commit f458b40f66
2 changed files with 3 additions and 3 deletions

View File

@ -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)) {

View File

@ -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) {