diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-08 10:28:34 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-08 10:35:06 +0300 |
commit | f458b40f66f33521ad3e4f0d4ebcbbcc501c89ed (patch) | |
tree | 3c5c2cb6061e2ae7ae4c55f50734170900fcd78d /storage | |
parent | e9dbbf112041cd9441ec0eee934e526617eb1213 (diff) | |
download | mariadb-git-f458b40f66f33521ad3e4f0d4ebcbbcc501c89ed.tar.gz |
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.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/srv/srv0srv.cc | 4 | ||||
-rw-r--r-- | storage/innobase/srv/srv0start.cc | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index cc85416aac7..6388f84cdea 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -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)) { diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 8efae318ee0..8479847f779 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -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) { |