Skip to content

Commit dc7c080

Browse files
committed
MDEV-17026 Assertion srv_undo_sources || ... failed on slow shutdown
trx_purge_add_update_undo_to_history(): Relax the too strict assertion by removing the condition on srv_fast_shutdown (innodb_fast_shutdown). Rollback is allowed during any form of shutdown.
1 parent 45dbd47 commit dc7c080

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

storage/innobase/trx/trx0purge.cc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
4+
Copyright (c) 2017, 2018, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -243,18 +243,20 @@ trx_purge_add_update_undo_to_history(
243243
hist_size + undo->size, MLOG_4BYTES, mtr);
244244
}
245245

246-
/* Before any transaction-generating background threads or the
246+
/* After the purge thread has been given permission to exit,
247+
we may roll back transactions (trx->undo_no==0)
248+
in THD::cleanup() invoked from unlink_thd() in fast shutdown,
249+
or in trx_rollback_resurrected() in slow shutdown.
250+
251+
Before any transaction-generating background threads or the
247252
purge have been started, recv_recovery_rollback_active() can
248253
start transactions in row_merge_drop_temp_indexes() and
249-
fts_drop_orphaned_tables(), and roll back recovered transactions.
250-
After the purge thread has been given permission to exit,
251-
in fast shutdown, we may roll back transactions (trx->undo_no==0)
252-
in THD::cleanup() invoked from unlink_thd(). */
254+
fts_drop_orphaned_tables(), and roll back recovered transactions. */
253255
ut_ad(srv_undo_sources
256+
|| trx->undo_no == 0
254257
|| ((srv_startup_is_before_trx_rollback_phase
255258
|| trx_rollback_or_clean_is_active)
256-
&& purge_sys->state == PURGE_STATE_INIT)
257-
|| (trx->undo_no == 0 && srv_fast_shutdown));
259+
&& purge_sys->state == PURGE_STATE_INIT));
258260

259261
/* Add the log as the first in the history list */
260262
flst_add_first(rseg_header + TRX_RSEG_HISTORY,

storage/xtradb/trx/trx0purge.cc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
4+
Copyright (c) 2017, 2018, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -247,18 +247,20 @@ trx_purge_add_update_undo_to_history(
247247
hist_size + undo->size, MLOG_4BYTES, mtr);
248248
}
249249

250-
/* Before any transaction-generating background threads or the
250+
/* After the purge thread has been given permission to exit,
251+
we may roll back transactions (trx->undo_no==0)
252+
in THD::cleanup() invoked from unlink_thd() in fast shutdown,
253+
or in trx_rollback_resurrected() in slow shutdown.
254+
255+
Before any transaction-generating background threads or the
251256
purge have been started, recv_recovery_rollback_active() can
252257
start transactions in row_merge_drop_temp_indexes() and
253-
fts_drop_orphaned_tables(), and roll back recovered transactions.
254-
After the purge thread has been given permission to exit,
255-
in fast shutdown, we may roll back transactions (trx->undo_no==0)
256-
in THD::cleanup() invoked from unlink_thd(). */
258+
fts_drop_orphaned_tables(), and roll back recovered transactions. */
257259
ut_ad(srv_undo_sources
260+
|| trx->undo_no == 0
258261
|| ((srv_startup_is_before_trx_rollback_phase
259262
|| trx_rollback_or_clean_is_active)
260-
&& purge_sys->state == PURGE_STATE_INIT)
261-
|| (trx->undo_no == 0 && srv_fast_shutdown));
263+
&& purge_sys->state == PURGE_STATE_INIT));
262264

263265
/* Add the log as the first in the history list */
264266
flst_add_first(rseg_header + TRX_RSEG_HISTORY,

0 commit comments

Comments
 (0)