Skip to content

Commit

Permalink
sporadic crashes of innodb.innodb_prefix_index_restart_server
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vuvova committed Dec 15, 2016
1 parent a8e0c6f commit eabb0ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions storage/innobase/srv/srv0srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eabb0ae

Please sign in to comment.