diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-15 12:09:46 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-15 12:09:46 +0200 |
commit | 34db9958e28c325b0f708f78b7ff029de810d5ea (patch) | |
tree | e62e1ca8506de67b926129e77691544fcadfabe5 /storage | |
parent | 396cf60ac064b47ca0406bf7f870df9880d3ad94 (diff) | |
download | mariadb-git-34db9958e28c325b0f708f78b7ff029de810d5ea.tar.gz |
MDEV-18936 Purge thread fails to exit on shutdown
When there is a huge transaction in the undo log, the purge threads
may get stuck in trx_purge_attach_undo_recs() for a long time,
causing the server to hang on a normal shutdown (innodb_fast_shutdown>0).
Apparently the innodb_purge_batch_size does not work correctly, or the
n_pages_handled is not being incremented correctly. We do not fix that
for now, but we will instead check if shutdown has been initiated,
allowing the purge threads to shut down without delays.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/trx/trx0purge.cc | 4 | ||||
-rw-r--r-- | storage/xtradb/trx/trx0purge.cc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index b9edac35c4d..5c7146fd730 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2018, MariaDB Corporation. +Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -989,7 +989,7 @@ trx_purge_attach_undo_recs( i = 0; - for (;;) { + while (UNIV_LIKELY(srv_undo_sources) || !srv_fast_shutdown) { purge_node_t* node; trx_purge_rec_t* purge_rec; diff --git a/storage/xtradb/trx/trx0purge.cc b/storage/xtradb/trx/trx0purge.cc index 11522ea5f9c..a9736e36075 100644 --- a/storage/xtradb/trx/trx0purge.cc +++ b/storage/xtradb/trx/trx0purge.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2018, MariaDB Corporation. +Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -989,7 +989,7 @@ trx_purge_attach_undo_recs( i = 0; - for (;;) { + while (UNIV_LIKELY(srv_undo_sources) || !srv_fast_shutdown) { purge_node_t* node; trx_purge_rec_t* purge_rec; |