mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
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 in2f5f3cd3ac
which was merged to MariaDB 10.2.2 in commit2e814d4702
. 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).
This commit is contained in:
parent
f5f56a076b
commit
67d89e4d7d
7 changed files with 14 additions and 8 deletions
|
@ -37,3 +37,4 @@ SELECT * FROM t;
|
|||
a
|
||||
3
|
||||
DROP TABLE t;
|
||||
FOUND 1 /Rolled back recovered transaction [^0]/ in mysqld.1.err
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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(*)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue