Commit baca5265 authored by Julius Goryavsky's avatar Julius Goryavsky

Merge remote-tracking branch 'origin/10.5-MDEV-22729' into 10.5

parents d3a2c2ea 198a4fee
...@@ -4,9 +4,7 @@ connection node_2; ...@@ -4,9 +4,7 @@ connection node_2;
connection node_1; connection node_1;
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3; connection node_3;
SET GLOBAL wsrep_on=OFF;
RESET MASTER; RESET MASTER;
SET GLOBAL wsrep_on=ON;
connection node_2a; connection node_2a;
START SLAVE; START SLAVE;
connection node_3; connection node_3;
...@@ -72,20 +70,17 @@ SET AUTOCOMMIT=ON; ...@@ -72,20 +70,17 @@ SET AUTOCOMMIT=ON;
START TRANSACTION; START TRANSACTION;
UPDATE t1 SET f2 = 'd' WHERE f1 = 3; UPDATE t1 SET f2 = 'd' WHERE f1 = 3;
connection node_2a; connection node_2a;
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
connection node_3; connection node_1;
UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3; UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3;
connection node_2a;
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
connection node_3; connection node_3;
COMMIT; COMMIT;
connection node_2a; connection node_2a;
SET GLOBAL debug_dbug = ""; SET GLOBAL debug_dbug = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
connection node_2a; connection node_2a;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync';
SET DEBUG_SYNC = "RESET";
connection node_2a;
set session wsrep_sync_wait=15; set session wsrep_sync_wait=15;
SELECT COUNT(*) = 1 FROM test.t1 WHERE f2 = 'e'; SELECT COUNT(*) = 1 FROM test.t1 WHERE f2 = 'e';
COUNT(*) = 1 COUNT(*) = 1
...@@ -93,9 +88,8 @@ COUNT(*) = 1 ...@@ -93,9 +88,8 @@ COUNT(*) = 1
set session wsrep_sync_wait=0; set session wsrep_sync_wait=0;
STOP SLAVE; STOP SLAVE;
RESET SLAVE; RESET SLAVE;
SET DEBUG_SYNC = "RESET";
DROP TABLE t1; DROP TABLE t1;
connection node_3; connection node_3;
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL wsrep_on=OFF;
RESET MASTER; RESET MASTER;
SET GLOBAL wsrep_on=ON;
!include ../galera_2nodes_as_slave.cnf
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
# #
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_log_bin.inc
--source include/have_debug.inc --source include/have_debug.inc
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
--source include/galera_have_debug_sync.inc --source include/galera_have_debug_sync.inc
...@@ -21,9 +22,7 @@ ...@@ -21,9 +22,7 @@
# #
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 --connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3 --connection node_3
SET GLOBAL wsrep_on=OFF;
RESET MASTER; RESET MASTER;
SET GLOBAL wsrep_on=ON;
--connection node_2a --connection node_2a
# #
...@@ -33,7 +32,7 @@ SET GLOBAL wsrep_on=ON; ...@@ -33,7 +32,7 @@ SET GLOBAL wsrep_on=ON;
# #
# nodes 1 and 2 form a galera cluster, node 2 operates as slave for native MariaDB naster in node 3 # nodes 1 and 2 form a galera cluster, node 2 operates as slave for native MariaDB master in node 3
# #
--disable_query_log --disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3; --eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
...@@ -156,35 +155,31 @@ UPDATE t1 SET f2 = 'd' WHERE f1 = 3; ...@@ -156,35 +155,31 @@ UPDATE t1 SET f2 = 'd' WHERE f1 = 3;
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1; --let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
--source include/wait_condition.inc --source include/wait_condition.inc
# Block the commit
--let $galera_sync_point = commit_monitor_master_enter_sync
--source include/galera_set_sync_point.inc
# block applier # block applier
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
# Inject a conflicting update from node 3 # Inject a conflicting update from node 1
--connection node_3 --connection node_1
UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3; UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3;
--connection node_2a
# wait until applier has reached the sync point
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
--let $expected_cert_failures = `SELECT VARIABLE_VALUE+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'`
# send the update from master # send the update from master
--connection node_3 --connection node_3
--error 0 --error 0
COMMIT; COMMIT;
--connection node_2a --connection node_2a
--let $wait_condition = SELECT VARIABLE_VALUE = $expected_cert_failures FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'
--source include/wait_condition.inc
# release the applier # release the applier from node 1
SET GLOBAL debug_dbug = ""; SET GLOBAL debug_dbug = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
# Unblock the async slave commit
--connection node_2a
--source include/galera_clear_sync_point.inc
--source include/galera_signal_sync_point.inc
SET DEBUG_SYNC = "RESET";
--connection node_2a --connection node_2a
set session wsrep_sync_wait=15; set session wsrep_sync_wait=15;
...@@ -193,11 +188,10 @@ set session wsrep_sync_wait=0; ...@@ -193,11 +188,10 @@ set session wsrep_sync_wait=0;
STOP SLAVE; STOP SLAVE;
RESET SLAVE; RESET SLAVE;
SET DEBUG_SYNC = "RESET";
DROP TABLE t1; DROP TABLE t1;
--connection node_3 --connection node_3
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL wsrep_on=OFF;
RESET MASTER; RESET MASTER;
SET GLOBAL wsrep_on=ON;
...@@ -313,7 +313,8 @@ extern "C" void wsrep_commit_ordered(THD *thd) ...@@ -313,7 +313,8 @@ extern "C" void wsrep_commit_ordered(THD *thd)
{ {
thd->wsrep_last_written_gtid_seqno= thd->wsrep_current_gtid_seqno; thd->wsrep_last_written_gtid_seqno= thd->wsrep_current_gtid_seqno;
} }
if (!wsrep_commit_will_write_binlog(thd)) if (thd->wsrep_trx().state() != wsrep::transaction::s_ordered_commit &&
!wsrep_commit_will_write_binlog(thd))
{ {
DEBUG_SYNC(thd, "before_wsrep_ordered_commit"); DEBUG_SYNC(thd, "before_wsrep_ordered_commit");
thd->wsrep_cs().ordered_commit(); thd->wsrep_cs().ordered_commit();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment