Skip to content

Commit d388e7e

Browse files
sysprgvuvova
authored andcommitted
MDEV-28583: Galera: binlogs disappear after rsync IST
This commit sends a flag indicating the presence of the "--bypass" option from the donor node to the joiner nodes during rsync IST, because without such a flag it is impossible to distinguish IST from the SST on the joiner nodes (in IST/SST scripts, because the "--bypass" option is still not passed to scripts from server code). Specifically, this fixes an issue with binary logs disappearing after IST (via rsync). There are also changes to diagnostic messages here that will make it easier to diagnose script-related problems in the future when debugging and when checking the logs. This commit also adds more robust signal handlers - to handle exceptions during script execution. These handlers won't mask some crashes and it also unifies exit codes between different scripts. These changes have already been helpful to debugging "bypass" flag handling.
1 parent b081ad8 commit d388e7e

9 files changed

+945
-145
lines changed
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
--- r/galera_ist_MDEV-28583.result
2+
+++ r/galera_ist_MDEV-28583,debug.reject
3+
@@ -517,3 +517,187 @@
4+
1
5+
DROP TABLE t1;
6+
COMMIT;
7+
+Performing State Transfer on a server that has been killed and restarted
8+
+while a DDL was in progress on it
9+
+connection node_1;
10+
+CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
11+
+SET AUTOCOMMIT=OFF;
12+
+START TRANSACTION;
13+
+INSERT INTO t1 VALUES (1,'node1_committed_before');
14+
+INSERT INTO t1 VALUES (2,'node1_committed_before');
15+
+INSERT INTO t1 VALUES (3,'node1_committed_before');
16+
+INSERT INTO t1 VALUES (4,'node1_committed_before');
17+
+INSERT INTO t1 VALUES (5,'node1_committed_before');
18+
+connection node_2;
19+
+START TRANSACTION;
20+
+INSERT INTO t1 VALUES (6,'node2_committed_before');
21+
+INSERT INTO t1 VALUES (7,'node2_committed_before');
22+
+INSERT INTO t1 VALUES (8,'node2_committed_before');
23+
+INSERT INTO t1 VALUES (9,'node2_committed_before');
24+
+INSERT INTO t1 VALUES (10,'node2_committed_before');
25+
+COMMIT;
26+
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
27+
+connection node_1;
28+
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
29+
+connection node_2;
30+
+SET wsrep_sync_wait = 0;
31+
+Killing server ...
32+
+connection node_1;
33+
+SET AUTOCOMMIT=OFF;
34+
+START TRANSACTION;
35+
+INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during');
36+
+INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during');
37+
+INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during');
38+
+INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during');
39+
+INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during');
40+
+COMMIT;
41+
+START TRANSACTION;
42+
+INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after');
43+
+INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after');
44+
+INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after');
45+
+INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after');
46+
+INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after');
47+
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
48+
+SET AUTOCOMMIT=OFF;
49+
+START TRANSACTION;
50+
+INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after');
51+
+INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after');
52+
+INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after');
53+
+INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after');
54+
+INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after');
55+
+connection node_2;
56+
+Performing --wsrep-recover ...
57+
+connection node_2;
58+
+Starting server ...
59+
+Using --wsrep-start-position when starting mysqld ...
60+
+SET AUTOCOMMIT=OFF;
61+
+START TRANSACTION;
62+
+INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after');
63+
+INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after');
64+
+INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after');
65+
+INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after');
66+
+INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after');
67+
+COMMIT;
68+
+connection node_1;
69+
+INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after');
70+
+INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after');
71+
+INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after');
72+
+INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after');
73+
+INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after');
74+
+COMMIT;
75+
+SET AUTOCOMMIT=OFF;
76+
+START TRANSACTION;
77+
+INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after');
78+
+INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after');
79+
+INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after');
80+
+INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after');
81+
+INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after');
82+
+COMMIT;
83+
+connection node_1a_galera_st_kill_slave_ddl;
84+
+INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after');
85+
+INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after');
86+
+INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after');
87+
+INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after');
88+
+INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after');
89+
+ROLLBACK;
90+
+SET AUTOCOMMIT=ON;
91+
+SET SESSION wsrep_sync_wait=15;
92+
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
93+
+EXPECT_3
94+
+3
95+
+SELECT COUNT(*) AS EXPECT_35 FROM t1;
96+
+EXPECT_35
97+
+35
98+
+SELECT * FROM t1;
99+
+id f1 f2
100+
+1 node1_committed_before NULL
101+
+2 node1_committed_before NULL
102+
+3 node1_committed_before NULL
103+
+4 node1_committed_before NULL
104+
+5 node1_committed_before NULL
105+
+6 node2_committed_before NULL
106+
+7 node2_committed_before NULL
107+
+8 node2_committed_before NULL
108+
+9 node2_committed_before NULL
109+
+10 node2_committed_before NULL
110+
+11 node1_committed_during NULL
111+
+12 node1_committed_during NULL
112+
+13 node1_committed_during NULL
113+
+14 node1_committed_during NULL
114+
+15 node1_committed_during NULL
115+
+16 node1_to_be_committed_after NULL
116+
+17 node1_to_be_committed_after NULL
117+
+18 node1_to_be_committed_after NULL
118+
+19 node1_to_be_committed_after NULL
119+
+20 node1_to_be_committed_after NULL
120+
+26 node2_committed_after NULL
121+
+27 node2_committed_after NULL
122+
+28 node2_committed_after NULL
123+
+29 node2_committed_after NULL
124+
+30 node2_committed_after NULL
125+
+31 node1_to_be_committed_after NULL
126+
+32 node1_to_be_committed_after NULL
127+
+33 node1_to_be_committed_after NULL
128+
+34 node1_to_be_committed_after NULL
129+
+35 node1_to_be_committed_after NULL
130+
+36 node1_committed_after NULL
131+
+37 node1_committed_after NULL
132+
+38 node1_committed_after NULL
133+
+39 node1_committed_after NULL
134+
+40 node1_committed_after NULL
135+
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
136+
+COUNT(*) = 0
137+
+1
138+
+COMMIT;
139+
+connection node_1;
140+
+SET AUTOCOMMIT=ON;
141+
+SET SESSION wsrep_sync_wait=15;
142+
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
143+
+EXPECT_3
144+
+3
145+
+SELECT COUNT(*) AS EXPECT_35 FROM t1;
146+
+EXPECT_35
147+
+35
148+
+SELECT * FROM t1;
149+
+id f1 f2
150+
+1 node1_committed_before NULL
151+
+2 node1_committed_before NULL
152+
+3 node1_committed_before NULL
153+
+4 node1_committed_before NULL
154+
+5 node1_committed_before NULL
155+
+6 node2_committed_before NULL
156+
+7 node2_committed_before NULL
157+
+8 node2_committed_before NULL
158+
+9 node2_committed_before NULL
159+
+10 node2_committed_before NULL
160+
+11 node1_committed_during NULL
161+
+12 node1_committed_during NULL
162+
+13 node1_committed_during NULL
163+
+14 node1_committed_during NULL
164+
+15 node1_committed_during NULL
165+
+16 node1_to_be_committed_after NULL
166+
+17 node1_to_be_committed_after NULL
167+
+18 node1_to_be_committed_after NULL
168+
+19 node1_to_be_committed_after NULL
169+
+20 node1_to_be_committed_after NULL
170+
+26 node2_committed_after NULL
171+
+27 node2_committed_after NULL
172+
+28 node2_committed_after NULL
173+
+29 node2_committed_after NULL
174+
+30 node2_committed_after NULL
175+
+31 node1_to_be_committed_after NULL
176+
+32 node1_to_be_committed_after NULL
177+
+33 node1_to_be_committed_after NULL
178+
+34 node1_to_be_committed_after NULL
179+
+35 node1_to_be_committed_after NULL
180+
+36 node1_committed_after NULL
181+
+37 node1_committed_after NULL
182+
+38 node1_committed_after NULL
183+
+39 node1_committed_after NULL
184+
+40 node1_committed_after NULL
185+
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
186+
+COUNT(*) = 0
187+
+1
188+
+DROP TABLE t1;
189+
+COMMIT;
190+
+SET GLOBAL debug_dbug = $debug_orig;

0 commit comments

Comments
 (0)