mirror of
https://github.com/MariaDB/server.git
synced 2025-09-15 05:41:27 +03:00
Test galera_sr_ddl_master would sometimes fail due to leftover
streaming replication fragments. Rollbacker thread would attempt to
open streaming_log table to remove the fragments, but would fail in
check_stack_overrun(). Ultimately the check_stack_overrun() failure
was caused by rollbacker missing to switch the victim's THD thread
stack to rollbacker's thread stack.
Also in this patch:
- Remove duplicate functionality in rollbacker helper functions,
and extract rollbacker fragment removal into function
wsrep_remove_streaming_fragments()
- Reuse open_for_write() in wsrep_schema::remove_fragments
- Partially revert changes to galera_sr_ddl_master test from
commit 44a11a7c08
. Removed unnecessary
wait condition and isolation level setting
66 lines
1.4 KiB
Plaintext
66 lines
1.4 KiB
Plaintext
connection node_2;
|
|
connection node_1;
|
|
connection node_1;
|
|
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
|
|
SET SESSION wsrep_trx_fragment_size = 1;
|
|
SET AUTOCOMMIT=OFF;
|
|
START TRANSACTION;
|
|
INSERT INTO t1 VALUES (1);
|
|
INSERT INTO t1 VALUES (2);
|
|
INSERT INTO t1 VALUES (3);
|
|
INSERT INTO t1 VALUES (4);
|
|
INSERT INTO t1 VALUES (5);
|
|
connection node_2;
|
|
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
SELECT COUNT(*) as expect_5 FROM mysql.wsrep_streaming_log;
|
|
expect_5
|
|
5
|
|
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
|
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
|
connection node_1;
|
|
INSERT INTO t1 VALUES (6);
|
|
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
|
SELECT COUNT(*) as expect_0 FROM mysql.wsrep_streaming_log;
|
|
expect_0
|
|
0
|
|
ROLLBACK;
|
|
START TRANSACTION;
|
|
INSERT INTO t1 (f1) VALUES (1);
|
|
INSERT INTO t1 (f1) VALUES (2);
|
|
INSERT INTO t1 (f1) VALUES (3);
|
|
INSERT INTO t1 (f1) VALUES (4);
|
|
INSERT INTO t1 (f1) VALUES (5);
|
|
INSERT INTO t1 (f1) VALUES (6);
|
|
COMMIT;
|
|
SELECT COUNT(*) as expect_6 FROM t1;
|
|
expect_6
|
|
6
|
|
SELECT * FROM t1;
|
|
f1 f2
|
|
1 NULL
|
|
2 NULL
|
|
3 NULL
|
|
4 NULL
|
|
5 NULL
|
|
6 NULL
|
|
SELECT COUNT(*) as expect_0 FROM mysql.wsrep_streaming_log;
|
|
expect_0
|
|
0
|
|
connection node_2;
|
|
SELECT COUNT(*) as expect_6 FROM t1;
|
|
expect_6
|
|
6
|
|
SELECT * FROM t1;
|
|
f1 f2
|
|
1 NULL
|
|
2 NULL
|
|
3 NULL
|
|
4 NULL
|
|
5 NULL
|
|
6 NULL
|
|
SELECT COUNT(*) as expect_0 FROM mysql.wsrep_streaming_log;
|
|
expect_0
|
|
0
|
|
DROP TABLE t1;
|