mirror of
https://github.com/MariaDB/server.git
synced 2025-11-25 17:25:02 +03:00
Assertions failed due to incorrect handling of the --tc-heuristic-recover
option when InnoDB is in read-only mode either due to innodb_read_only=1
or innodb_force_recovery>3. InnoDB failed to refuse a XA COMMIT or
XA ROLLBACK operation, and there were errors in the error handling in
the upper layer.
This was fixed by making InnoDB XA operations respect the
high_level_read_only flag. The InnoDB part of the fix and
parts of the test main.tc_heuristic_recover were provided
by Marko Mäkelä.
LOCK_log mutex lock/unlock had to be added to fix MDEV-13438.
The measure is confirmed by mysql sources as well.
For testing of the conflicting option combination, mysql-test-run is
made to export a new $MYSQLD_LAST_CMD. It holds the very last value
generated by mtr.mysqld_start(). Even though the options have been
also always stored in $mysqld->{'started_opts'} there were no access
to them beyond the automatic server restart by mtr through the expect
file interface.
Effectively therefore $MYSQLD_LAST_CMD represents a more general
interface to $mysqld->{'started_opts'} which can be used in wider
scopes including server launch with incompatible options.
Notice another existing method to restart the server with incompatible
options relying on $MYSQLD_CMD is is aware of $mysqld->{'started_opts'}
(the actual options that the server is launched by mtr). In order to use
this method they would have to be provided manually.
NOTE: When merging to 10.2, the file search_pattern_in_file++.inc
should be replaced with the pre-existing search_pattern_in_file.inc.
38 lines
1.4 KiB
Plaintext
38 lines
1.4 KiB
Plaintext
call mtr.add_suppression("Can't init tc log");
|
|
call mtr.add_suppression("Found 1 prepared transactions!");
|
|
call mtr.add_suppression("Aborting");
|
|
set debug_sync='RESET';
|
|
CREATE TABLE t1 (i INT) ENGINE=InnoDB;
|
|
SET GLOBAL innodb_flush_log_at_trx_commit=1;
|
|
FLUSH TABLES;
|
|
set debug_sync='ha_commit_trans_after_prepare WAIT_FOR go';
|
|
INSERT INTO t1 VALUES (1);;
|
|
# Prove that no COMMIT or ROLLBACK occurred yet.
|
|
SELECT * FROM t1;
|
|
i
|
|
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
SELECT * FROM t1;
|
|
i
|
|
1
|
|
# Kill the server
|
|
FOUND 1 /was in the XA prepared state/ in mysqld.1.err
|
|
FOUND 1 /Found 1 prepared transactions!/ in mysqld.1.err
|
|
NOT FOUND /\[ERROR\] Can\'t init tc log/ in mysqld.1.err
|
|
FOUND 2 /was in the XA prepared state/ in mysqld.1.err
|
|
FOUND 1 /Found 1 prepared transactions!/ in mysqld.1.err
|
|
FOUND 1 /\[ERROR\] Can\'t init tc log/ in mysqld.1.err
|
|
FOUND 1 /Please restart mysqld without --tc-heuristic-recover/ in mysqld.1.err
|
|
FOUND 3 /was in the XA prepared state/ in mysqld.1.err
|
|
FOUND 1 /Found 1 prepared transactions!/ in mysqld.1.err
|
|
FOUND 2 /\[ERROR\] Can\'t init tc log/ in mysqld.1.err
|
|
FOUND 2 /Please restart mysqld without --tc-heuristic-recover/ in mysqld.1.err
|
|
FOUND 3 /was in the XA prepared state/ in mysqld.1.err
|
|
FOUND 1 /Found 1 prepared transactions!/ in mysqld.1.err
|
|
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
SELECT * FROM t1;
|
|
i
|
|
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
SELECT * FROM t1;
|
|
i
|
|
DROP TABLE t1;
|