mirror of
https://github.com/MariaDB/server.git
synced 2025-02-09 23:24:11 +01:00
![sjaakola](/assets/img/avatar_default.png)
The underlying problem with MDEV-25551 turned out to be that transactions having changes for tables with no primary key, were not safe to apply in parallel. This is due to excessive locking in innodb side, and even non related row modifications could end up in lock conflict during applying. The fix for MDEV-25551 has disabled parallel applying for tables with no PK. This fix depends on change for wsrep-lib, where a separate PR allows application to modify transaction flags in wsrep-lib. This commit has also separate mtr test for verifying that transactions modifying a table with no primary key, will not apply in parallel. This test is a modified version of initial test created by Gabor Orosz, the reporterr of MDEV-25551. Another mtr test was added in galera_sr suite, for testing if modifying tables with no primary key would causes issues for streaming replication use cases. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
63 lines
2 KiB
Text
63 lines
2 KiB
Text
connection node_2;
|
|
connection node_1;
|
|
CREATE TABLE t1 (f1 VARCHAR(32) NOT NULL) ENGINE=InnoDB;
|
|
INSERT INTO t1 (f1) VALUES ('0e66c5227a8a');
|
|
INSERT INTO t1 (f1) VALUES ('c6c112992c9');
|
|
CREATE TABLE t2 (i int primary key);
|
|
connection node_2;
|
|
SET SESSION wsrep_sync_wait = 0;
|
|
SET GLOBAL wsrep_slave_threads = 2;
|
|
***************************************************************
|
|
scenario 1, conflicting UPDATE
|
|
***************************************************************
|
|
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_slave_enter_sync';
|
|
connection node_1;
|
|
START TRANSACTION;
|
|
UPDATE t1 SET f1='5ffceebfada' WHERE t1.f1 = 'c6c112992c9';
|
|
COMMIT;
|
|
connection node_2;
|
|
SET SESSION wsrep_on = 0;
|
|
SET SESSION wsrep_on = 1;
|
|
connection node_1;
|
|
START TRANSACTION;
|
|
UPDATE t1 SET f1='4ffceebfcdc' WHERE t1.f1 = '0e66c5227a8a';
|
|
COMMIT;
|
|
connection node_2;
|
|
distance
|
|
1
|
|
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_slave_enter_sync';
|
|
SET SESSION wsrep_on = 0;
|
|
SET SESSION wsrep_on = 1;
|
|
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_slave_enter_sync';
|
|
SET GLOBAL wsrep_provider_options = 'dbug=';
|
|
***************************************************************
|
|
scenario 2, conflicting DELETE
|
|
***************************************************************
|
|
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_slave_enter_sync';
|
|
connection node_1;
|
|
START TRANSACTION;
|
|
INSERT INTO t2 VALUES (1);
|
|
DELETE FROM t1 WHERE f1='5ffceebfada';
|
|
COMMIT;
|
|
connection node_2;
|
|
SET SESSION wsrep_on = 0;
|
|
SET SESSION wsrep_on = 1;
|
|
connection node_1;
|
|
START TRANSACTION;
|
|
INSERT INTO t2 VALUES (2);
|
|
DELETE FROM t1 WHERE f1='4ffceebfcdc';
|
|
COMMIT;
|
|
connection node_2;
|
|
distance
|
|
1
|
|
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_slave_enter_sync';
|
|
SET SESSION wsrep_on = 0;
|
|
SET SESSION wsrep_on = 1;
|
|
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_slave_enter_sync';
|
|
SET GLOBAL wsrep_provider_options = 'dbug=';
|
|
connection node_1;
|
|
SET GLOBAL wsrep_slave_threads = DEFAULT;
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
connection node_2;
|
|
SET GLOBAL wsrep_slave_threads = DEFAULT;
|