Skip to content

Commit baca526

Browse files
committed
Merge remote-tracking branch 'origin/10.5-MDEV-22729' into 10.5
2 parents d3a2c2e + 198a4fe commit baca526

File tree

4 files changed

+21
-31
lines changed

4 files changed

+21
-31
lines changed

mysql-test/suite/galera/r/galera_slave_replay.result

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ connection node_2;
44
connection node_1;
55
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
66
connection node_3;
7-
SET GLOBAL wsrep_on=OFF;
87
RESET MASTER;
9-
SET GLOBAL wsrep_on=ON;
108
connection node_2a;
119
START SLAVE;
1210
connection node_3;
@@ -72,30 +70,26 @@ SET AUTOCOMMIT=ON;
7270
START TRANSACTION;
7371
UPDATE t1 SET f2 = 'd' WHERE f1 = 3;
7472
connection node_2a;
75-
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync';
7673
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
77-
connection node_3;
74+
connection node_1;
7875
UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3;
76+
connection node_2a;
77+
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
7978
connection node_3;
8079
COMMIT;
8180
connection node_2a;
8281
SET GLOBAL debug_dbug = "";
8382
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
8483
connection node_2a;
85-
SET GLOBAL wsrep_provider_options = 'dbug=';
86-
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync';
87-
SET DEBUG_SYNC = "RESET";
88-
connection node_2a;
8984
set session wsrep_sync_wait=15;
9085
SELECT COUNT(*) = 1 FROM test.t1 WHERE f2 = 'e';
9186
COUNT(*) = 1
9287
1
9388
set session wsrep_sync_wait=0;
9489
STOP SLAVE;
9590
RESET SLAVE;
91+
SET DEBUG_SYNC = "RESET";
9692
DROP TABLE t1;
9793
connection node_3;
9894
DROP TABLE t1;
99-
SET GLOBAL wsrep_on=OFF;
10095
RESET MASTER;
101-
SET GLOBAL wsrep_on=ON;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!include ../galera_2nodes_as_slave.cnf

mysql-test/suite/galera/t/galera_slave_replay.test

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88

99
--source include/have_innodb.inc
10+
--source include/have_log_bin.inc
1011
--source include/have_debug.inc
1112
--source include/have_debug_sync.inc
1213
--source include/galera_have_debug_sync.inc
@@ -21,9 +22,7 @@
2122
#
2223
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
2324
--connection node_3
24-
SET GLOBAL wsrep_on=OFF;
2525
RESET MASTER;
26-
SET GLOBAL wsrep_on=ON;
2726

2827
--connection node_2a
2928
#
@@ -33,10 +32,10 @@ SET GLOBAL wsrep_on=ON;
3332

3433

3534
#
36-
# nodes 1 and 2 form a galera cluster, node 2 operates as slave for native MariaDB naster in node 3
35+
# nodes 1 and 2 form a galera cluster, node 2 operates as slave for native MariaDB master in node 3
3736
#
3837
--disable_query_log
39-
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
38+
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
4039
--enable_query_log
4140
START SLAVE;
4241

@@ -156,35 +155,31 @@ UPDATE t1 SET f2 = 'd' WHERE f1 = 3;
156155
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
157156
--source include/wait_condition.inc
158157

159-
# Block the commit
160-
--let $galera_sync_point = commit_monitor_master_enter_sync
161-
--source include/galera_set_sync_point.inc
162-
163158
# block applier
164159
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
165160

166-
# Inject a conflicting update from node 3
167-
--connection node_3
161+
# Inject a conflicting update from node 1
162+
--connection node_1
168163
UPDATE test.t1 SET f2 = 'e' WHERE f1 = 3;
169164

165+
--connection node_2a
166+
# wait until applier has reached the sync point
167+
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
168+
--let $expected_cert_failures = `SELECT VARIABLE_VALUE+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'`
169+
170170
# send the update from master
171171
--connection node_3
172172
--error 0
173173
COMMIT;
174174

175175
--connection node_2a
176+
--let $wait_condition = SELECT VARIABLE_VALUE = $expected_cert_failures FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'
177+
--source include/wait_condition.inc
176178

177-
# release the applier
179+
# release the applier from node 1
178180
SET GLOBAL debug_dbug = "";
179181
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
180182

181-
182-
# Unblock the async slave commit
183-
--connection node_2a
184-
--source include/galera_clear_sync_point.inc
185-
--source include/galera_signal_sync_point.inc
186-
SET DEBUG_SYNC = "RESET";
187-
188183
--connection node_2a
189184

190185
set session wsrep_sync_wait=15;
@@ -193,11 +188,10 @@ set session wsrep_sync_wait=0;
193188

194189
STOP SLAVE;
195190
RESET SLAVE;
191+
SET DEBUG_SYNC = "RESET";
196192

197193
DROP TABLE t1;
198194

199195
--connection node_3
200196
DROP TABLE t1;
201-
SET GLOBAL wsrep_on=OFF;
202197
RESET MASTER;
203-
SET GLOBAL wsrep_on=ON;

sql/service_wsrep.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ extern "C" void wsrep_commit_ordered(THD *thd)
313313
{
314314
thd->wsrep_last_written_gtid_seqno= thd->wsrep_current_gtid_seqno;
315315
}
316-
if (!wsrep_commit_will_write_binlog(thd))
316+
if (thd->wsrep_trx().state() != wsrep::transaction::s_ordered_commit &&
317+
!wsrep_commit_will_write_binlog(thd))
317318
{
318319
DEBUG_SYNC(thd, "before_wsrep_ordered_commit");
319320
thd->wsrep_cs().ordered_commit();

0 commit comments

Comments
 (0)