Skip to content

Commit

Permalink
MDEV-22827 InnoDB: Failing assertion: purge_sys->n_stop == 0
Browse files Browse the repository at this point in the history
When MDEV-22769 introduced srv_shutdown_state=SRV_SHUTDOWN_INITIATED in
commit efc70da
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.
  • Loading branch information
dr-m committed Jun 8, 2020
1 parent e9dbbf1 commit f458b40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions storage/innobase/srv/srv0srv.cc
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/srv/srv0start.cc
Expand Up @@ -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) {

Expand Down

0 comments on commit f458b40

Please sign in to comment.