summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-12-14 17:47:24 +0100
committerSergei Golubchik <serg@mariadb.org>2016-12-14 20:20:28 +0100
commitea6f0c949f083b7e2a82bd3a234ec80686bf3d57 (patch)
tree2dd16076e2c54504ea05e33b2382434a60af4b7b
parente9ada862651fdb98f84871e4ec59bef1bb36646d (diff)
downloadmariadb-git-ea6f0c949f083b7e2a82bd3a234ec80686bf3d57.tar.gz
sporadic crashes of innodb.innodb_prefix_index_restart_server
in slow shutdown mode purge threads really must exit only when there is nothing to purge. Restore the trx_commit_disallowed check and don't stop purge threads until all connection thread transactions are gone.
-rw-r--r--storage/innobase/handler/ha_innodb.cc6
-rw-r--r--storage/innobase/srv/srv0srv.cc6
2 files changed, 12 insertions, 0 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index cac438c71d8..42dce9d79b7 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -340,6 +340,12 @@ thd_destructor_proxy(void *)
mysql_mutex_unlock(&thd_destructor_mutex);
thd_destructor_myvar = NULL;
+ srv_fast_shutdown = (ulint) innobase_fast_shutdown;
+ if (srv_fast_shutdown == 0) {
+ while (trx_sys_any_active_transactions()) {
+ os_thread_sleep(1000);
+ }
+ }
srv_purge_wakeup();
destroy_thd(thd);
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 2e9e3b7ea8a..efc33a9baa2 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -3073,6 +3073,12 @@ DECLARE_THREAD(srv_purge_coordinator_thread)(
n_pages_purged = trx_purge(1, srv_purge_batch_size, false);
}
+#ifdef UNIV_DEBUG
+ if (srv_fast_shutdown == 0) {
+ trx_commit_disallowed = true;
+ }
+#endif /* UNIV_DEBUG */
+
/* This trx_purge is called to remove any undo records (added by
background threads) after completion of the above loop. When
srv_fast_shutdown != 0, a large batch size can cause significant