summaryrefslogtreecommitdiff
path: root/storage/xtradb/trx
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-02-13 13:01:14 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-02-13 14:29:32 +0200
commitc051eaba46f2a9570bba3f3a64708502ff0aa03c (patch)
treec0057ac4fdde43b8b0691b063f35954cc698c225 /storage/xtradb/trx
parentb0a92333c00f8facd20c55cf7a8dfaf896b7f24d (diff)
downloadmariadb-git-c051eaba46f2a9570bba3f3a64708502ff0aa03c.tar.gz
MDEV-14988 innodb_read_only tries to modify files if transactions were recovered in COMMITTED state
lock_trx_release_locks(): Relax a debug assertion to allow recovered TRX_STATE_COMMITTED_IN_MEMORY transactions. trx_commit_in_memory(): Add DEBUG_SYNC instrumentation. trx_undo_insert_cleanup(): Skip persistent changes if innodb_read_only is set. This should only happen when a recovered committed transaction would be cleaned up at shutdown.
Diffstat (limited to 'storage/xtradb/trx')
-rw-r--r--storage/xtradb/trx/trx0trx.cc4
-rw-r--r--storage/xtradb/trx/trx0undo.cc6
2 files changed, 7 insertions, 3 deletions
diff --git a/storage/xtradb/trx/trx0trx.cc b/storage/xtradb/trx/trx0trx.cc
index 45578283235..701ac3ed72d 100644
--- a/storage/xtradb/trx/trx0trx.cc
+++ b/storage/xtradb/trx/trx0trx.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 2018, 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
@@ -1442,6 +1442,8 @@ trx_commit_in_memory(
if (lsn) {
ulint flush_log_at_trx_commit;
+ DEBUG_SYNC_C("after_trx_committed_in_memory");
+
if (trx->insert_undo != NULL) {
trx_undo_insert_cleanup(trx);
diff --git a/storage/xtradb/trx/trx0undo.cc b/storage/xtradb/trx/trx0undo.cc
index d6bcd131a4f..370b3f181a1 100644
--- a/storage/xtradb/trx/trx0undo.cc
+++ b/storage/xtradb/trx/trx0undo.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2017, MariaDB Corporation.
+Copyright (c) 2014, 2018, 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
@@ -1989,7 +1989,9 @@ trx_undo_insert_cleanup(
mutex_exit(&(rseg->mutex));
- trx_undo_seg_free(undo);
+ if (!srv_read_only_mode) {
+ trx_undo_seg_free(undo);
+ }
mutex_enter(&(rseg->mutex));