diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-09-06 11:53:10 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-09-06 11:53:10 +0200 |
commit | 244f0e6dd815b388282c15db4fe7f15533f4c8fc (patch) | |
tree | af138f2b3739a742c0c38173cdc86ec176fc0edd /storage/innobase/trx/trx0roll.cc | |
parent | 18af13b88ba580562981a190c25da128a2e9db26 (diff) | |
parent | 2842c369851a8afc2a944ce6f4f60fa052f20969 (diff) | |
download | mariadb-git-244f0e6dd815b388282c15db4fe7f15533f4c8fc.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'storage/innobase/trx/trx0roll.cc')
-rw-r--r-- | storage/innobase/trx/trx0roll.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index 61f0ce57777..b81b1ab3dee 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -762,7 +762,7 @@ static my_bool trx_rollback_recovered_callback(rw_trx_hash_element_t *element, if (trx_t *trx= element->trx) { mutex_enter(&trx->mutex); - if (trx->is_recovered && trx_state_eq(trx, TRX_STATE_ACTIVE)) + if (trx_state_eq(trx, TRX_STATE_ACTIVE) && trx->is_recovered) trx_list->push_back(trx); mutex_exit(&trx->mutex); } @@ -808,7 +808,8 @@ void trx_rollback_recovered(bool all) ut_ad(trx); ut_d(trx_mutex_enter(trx)); - ut_ad(trx->is_recovered && trx_state_eq(trx, TRX_STATE_ACTIVE)); + ut_ad(trx->is_recovered); + ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE)); ut_d(trx_mutex_exit(trx)); if (!srv_is_being_started && !srv_undo_sources && srv_fast_shutdown) @@ -824,6 +825,22 @@ void trx_rollback_recovered(bool all) ut_ad(!srv_undo_sources); ut_ad(srv_fast_shutdown); discard: + /* Note: before kill_server() invoked innobase_end() via + unireg_end(), it invoked close_connections(), which should initiate + the rollback of any user transactions via THD::cleanup() in the + connection threads, and wait for all THD::cleanup() to complete. + So, no active user transactions should exist at this point. + + srv_undo_sources=false was cleared early in innobase_end(). + + Generally, the server guarantees that all connections using + InnoDB must be disconnected by the time we are reaching this code, + be it during shutdown or UNINSTALL PLUGIN. + + Because there is no possible race condition with any + concurrent user transaction, we do not have to invoke + trx->commit_state() or wait for !trx->is_referenced() + before trx_sys.deregister_rw(trx). */ trx_sys.deregister_rw(trx); trx_free_at_shutdown(trx); } |