diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-01-31 12:01:35 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-01-31 12:06:46 +0200 |
commit | 67d89e4d7deb85fa11a18432a207eb59da6d600d (patch) | |
tree | 80cf9bfcd83f5267b80c5a682aca33572ff3402d | |
parent | f5f56a076b6ea45ea39c47f418846168c192fbd0 (diff) | |
download | mariadb-git-67d89e4d7deb85fa11a18432a207eb59da6d600d.tar.gz |
MDEV-15143 InnoDB: Rollback of trx with id 0 completed
When InnoDB has completed the rollback of a recovered transaction,
it used to display the transaction identifier.
This was broken in MySQL 5.7.2 in
https://github.com/mysql/mysql-server/commit/2f5f3cd3ac46d46c7635e778b338f63b5521cd46
which was merged to MariaDB 10.2.2 in
commit 2e814d4702d71a04388386a9f591d14a35980bfe.
trx_rollback_active(): Cache the transaction ID before it will be
reset by transaction commit. Do not display the message if the
rollback was interrupted by shutdown (MDEV-13797, MDEV-12352).
7 files changed, 14 insertions, 8 deletions
diff --git a/mysql-test/suite/innodb/r/read_only_recovery.result b/mysql-test/suite/innodb/r/read_only_recovery.result index 97ec938fb2a..e639e8abacc 100644 --- a/mysql-test/suite/innodb/r/read_only_recovery.result +++ b/mysql-test/suite/innodb/r/read_only_recovery.result @@ -37,3 +37,4 @@ SELECT * FROM t; a 3 DROP TABLE t; +FOUND 1 /Rolled back recovered transaction [^0]/ in mysqld.1.err diff --git a/mysql-test/suite/innodb/t/read_only_recovery.test b/mysql-test/suite/innodb/t/read_only_recovery.test index aea676d3644..7da012efb74 100644 --- a/mysql-test/suite/innodb/t/read_only_recovery.test +++ b/mysql-test/suite/innodb/t/read_only_recovery.test @@ -41,3 +41,6 @@ SELECT * FROM t; --source include/restart_mysqld.inc SELECT * FROM t; DROP TABLE t; +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; +--let SEARCH_PATTERN= Rolled back recovered transaction [^0] +--source include/search_pattern_in_file.inc diff --git a/mysql-test/suite/mariabackup/apply-log-only-incr.result b/mysql-test/suite/mariabackup/apply-log-only-incr.result index 114a471aa2c..917a9647511 100644 --- a/mysql-test/suite/mariabackup/apply-log-only-incr.result +++ b/mysql-test/suite/mariabackup/apply-log-only-incr.result @@ -10,9 +10,9 @@ SET GLOBAL innodb_flush_log_at_trx_commit = 1; ROLLBACK; disconnect flush_log; connection default; -NOT FOUND /Rollback of trx with id/ in current_test +NOT FOUND /Rolled back recovered transaction/ in current_test # expect NOT FOUND -NOT FOUND /Rollback of trx with id/ in current_test +NOT FOUND /Rolled back recovered transaction/ in current_test # expect NOT FOUND commit; SELECT count(*) FROM t; diff --git a/mysql-test/suite/mariabackup/apply-log-only-incr.test b/mysql-test/suite/mariabackup/apply-log-only-incr.test index 81c91d3c452..25cb3a82023 100644 --- a/mysql-test/suite/mariabackup/apply-log-only-incr.test +++ b/mysql-test/suite/mariabackup/apply-log-only-incr.test @@ -40,7 +40,7 @@ exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir ; --enable_result_log let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test; ---let SEARCH_PATTERN= Rollback of trx with id +--let SEARCH_PATTERN= Rolled back recovered transaction --source include/search_pattern_in_file.inc --echo # expect NOT FOUND diff --git a/mysql-test/suite/mariabackup/apply-log-only.result b/mysql-test/suite/mariabackup/apply-log-only.result index 04b9c0d8ee2..d618a7bbeb5 100644 --- a/mysql-test/suite/mariabackup/apply-log-only.result +++ b/mysql-test/suite/mariabackup/apply-log-only.result @@ -2,7 +2,7 @@ call mtr.add_suppression("InnoDB: New log files created"); CREATE TABLE t(a varchar(60)) ENGINE INNODB; start transaction; INSERT INTO t VALUES(1); -NOT FOUND /Rollback of trx with id/ in current_test +NOT FOUND /Rolled back recovered transaction/ in current_test # expect NOT FOUND SELECT count(*) FROM t; count(*) diff --git a/mysql-test/suite/mariabackup/apply-log-only.test b/mysql-test/suite/mariabackup/apply-log-only.test index 96a251fc03b..5a3c45f2914 100644 --- a/mysql-test/suite/mariabackup/apply-log-only.test +++ b/mysql-test/suite/mariabackup/apply-log-only.test @@ -14,7 +14,7 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir ; let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test; ---let SEARCH_PATTERN= Rollback of trx with id +--let SEARCH_PATTERN= Rolled back recovered transaction --source include/search_pattern_in_file.inc --echo # expect NOT FOUND diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index e5ff505365b..ab500cfbfad 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -627,6 +627,9 @@ trx_rollback_active( roll_node_t* roll_node; dict_table_t* table; ibool dictionary_locked = FALSE; + const trx_id_t trx_id = trx->id; + + ut_ad(trx_id); heap = mem_heap_create(512); @@ -698,14 +701,13 @@ trx_rollback_active( } } + ib::info() << "Rolled back recovered transaction " << trx_id; + func_exit: if (dictionary_locked) { row_mysql_unlock_data_dictionary(trx); } - ib::info() << "Rollback of trx with id " << ib::hex(trx->id) - << " completed"; - mem_heap_free(heap); trx_roll_crash_recv_trx = NULL; |