Skip to content

Commit 3a42308

Browse files
committed
Merge 10.3 into 10.4
2 parents 29847a3 + fba6ffe commit 3a42308

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+982
-1742
lines changed

extra/mariabackup/backup_mysql.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,7 @@ write_slave_info(MYSQL *connection)
10921092
char *master = NULL;
10931093
char *filename = NULL;
10941094
char *gtid_executed = NULL;
1095+
char *using_gtid = NULL;
10951096
char *position = NULL;
10961097
char *gtid_slave_pos = NULL;
10971098
char *ptr;
@@ -1102,6 +1103,7 @@ write_slave_info(MYSQL *connection)
11021103
{"Relay_Master_Log_File", &filename},
11031104
{"Exec_Master_Log_Pos", &position},
11041105
{"Executed_Gtid_Set", &gtid_executed},
1106+
{"Using_Gtid", &using_gtid},
11051107
{NULL, NULL}
11061108
};
11071109

@@ -1142,7 +1144,8 @@ write_slave_info(MYSQL *connection)
11421144
ut_a(asprintf(&mysql_slave_position,
11431145
"master host '%s', purge list '%s'",
11441146
master, gtid_executed) != -1);
1145-
} else if (gtid_slave_pos && *gtid_slave_pos) {
1147+
} else if (gtid_slave_pos && *gtid_slave_pos &&
1148+
!(using_gtid && !strncmp(using_gtid, "No", 2))) {
11461149
/* MariaDB >= 10.0 with GTID enabled */
11471150
result = backup_file_printf(XTRABACKUP_SLAVE_INFO,
11481151
"SET GLOBAL gtid_slave_pos = '%s';\n"

include/mysql/service_wsrep.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ extern struct wsrep_service_st {
8585
void (*wsrep_commit_ordered_func)(MYSQL_THD thd);
8686
my_bool (*wsrep_thd_is_applying_func)(const MYSQL_THD thd);
8787
bool (*wsrep_thd_set_wsrep_aborter_func)(MYSQL_THD bf_thd, MYSQL_THD thd);
88+
void (*wsrep_report_bf_lock_wait_func)(const MYSQL_THD thd,
89+
unsigned long long trx_id);
8890
} *wsrep_service;
8991

9092
#define MYSQL_SERVICE_WSREP_INCLUDED
@@ -126,7 +128,7 @@ extern struct wsrep_service_st {
126128
#define wsrep_commit_ordered(T) wsrep_service->wsrep_commit_ordered_func(T)
127129
#define wsrep_thd_is_applying(T) wsrep_service->wsrep_thd_is_applying_func(T)
128130
#define wsrep_thd_set_wsrep_aborter(T) wsrep_service->wsrep_thd_set_wsrep_aborter_func(T1, T2)
129-
131+
#define wsrep_report_bf_lock_wait(T,I) wsrep_service->wsrep_report_bf_lock_wait(T,I)
130132
#else
131133

132134
#define MYSQL_SERVICE_WSREP_STATIC_INCLUDED
@@ -221,6 +223,7 @@ extern "C" my_bool wsrep_get_debug();
221223
extern "C" void wsrep_commit_ordered(MYSQL_THD thd);
222224
extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
223225
extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd);
224-
226+
extern "C" void wsrep_report_bf_lock_wait(const THD *thd,
227+
unsigned long long trx_id);
225228
#endif
226229
#endif /* MYSQL_SERVICE_WSREP_INCLUDED */

mysql-test/main/windows_debug.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# mdev-23741 sharing violation when renaming .frm file in ALTER
2+
CREATE TABLE t(i int);
3+
SET STATEMENT debug_dbug='+d,rename_sharing_violation' FOR ALTER TABLE t ADD PRIMARY KEY (i);
4+
DROP TABLE t;

mysql-test/main/windows_debug.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Windows-specific tests , debug mode
2+
3+
--source include/have_debug.inc
4+
--source include/windows.inc
5+
6+
--echo # mdev-23741 sharing violation when renaming .frm file in ALTER
7+
CREATE TABLE t(i int);
8+
SET STATEMENT debug_dbug='+d,rename_sharing_violation' FOR ALTER TABLE t ADD PRIMARY KEY (i);
9+
DROP TABLE t;
10+
11+
#End of 10.3 tests

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

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,45 @@ connection node_1;
44
connection node_2;
55
connection node_1;
66
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
7-
CREATE PROCEDURE p1 ()
8-
BEGIN
9-
DECLARE x INT DEFAULT 1;
10-
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
11-
WHILE 1 DO
12-
INSERT INTO t1 VALUES (DEFAULT);
13-
COMMIT;
14-
END WHILE;
15-
END|
16-
CALL p1();;
17-
connection node_2;
18-
CALL p1();;
7+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
198
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
209
connection node_2a;
2110
Killing server ...
22-
INSERT INTO t1 VALUES (DEFAULT);
23-
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
24-
connection node_1a;
25-
INSERT INTO t1 VALUES (DEFAULT);
2611
connection node_1;
27-
Got one of the listed errors
28-
connection node_2;
29-
Got one of the listed errors
30-
connection node_1a;
12+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
13+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
14+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
15+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
16+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
17+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
18+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
19+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
20+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
21+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
3122
connection node_2a;
32-
count_equal
33-
1
34-
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
35-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
36-
VARIABLE_VALUE
37-
2
38-
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
39-
VARIABLE_VALUE = 2
40-
1
23+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
24+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
25+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
26+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
27+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
28+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
29+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
30+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
31+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
32+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
33+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
34+
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
4135
connection node_1a;
42-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
43-
VARIABLE_VALUE
44-
2
45-
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
46-
VARIABLE_VALUE = 2
47-
1
48-
DROP PROCEDURE p1;
36+
SELECT COUNT(*) FROM t1;
37+
COUNT(*)
38+
132
39+
connection node_2a;
40+
SELECT COUNT(*) FROM t1;
41+
COUNT(*)
42+
132
43+
connection node_1;
4944
DROP TABLE t1;
5045
CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
5146
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
47+
disconnect node_1a;
48+
disconnect node_2a;

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

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ connection node_1;
66
connection node_2;
77
connection node_3;
88
connection node_4;
9-
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
10-
VARIABLE_VALUE = 4
11-
1
9+
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
10+
EXPECT_4
11+
4
1212
connection node_1;
13-
CREATE TABLE t1 (f1 INTEGER);
13+
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=INNODB;
1414
INSERT INTO t1 VALUES (1);
1515
connection node_2;
1616
INSERT INTO t1 VALUES (2);
@@ -22,60 +22,78 @@ connection node_3;
2222
INSERT INTO t1 VALUES (13);
2323
Shutting down server ...
2424
connection node_1;
25+
SELECT VARIABLE_VALUE AS EXPECT_3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
26+
EXPECT_3
27+
3
2528
INSERT INTO t1 VALUES (11);
2629
connection node_2;
2730
INSERT INTO t1 VALUES (12);
2831
connection node_4;
2932
INSERT INTO t1 VALUES (14);
3033
connection node_3;
34+
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
35+
EXPECT_4
36+
4
3137
INSERT INTO t1 VALUES (131);
3238
connection node_2;
3339
INSERT INTO t1 VALUES (22);
3440
Shutting down server ...
3541
connection node_1;
42+
SELECT VARIABLE_VALUE AS EXPECT_3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
43+
EXPECT_3
44+
3
3645
INSERT INTO t1 VALUES (21);
3746
connection node_3;
3847
INSERT INTO t1 VALUES (23);
3948
connection node_4;
4049
INSERT INTO t1 VALUES (24);
4150
connection node_2;
51+
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
52+
EXPECT_4
53+
4
4254
INSERT INTO t1 VALUES (221);
4355
connection node_4;
4456
INSERT INTO t1 VALUES (34);
4557
Shutting down server ...
4658
connection node_1;
59+
SELECT VARIABLE_VALUE AS EXPECT_3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
60+
EXPECT_3
61+
3
4762
INSERT INTO t1 VALUES (31);
4863
connection node_2;
4964
INSERT INTO t1 VALUES (32);
5065
connection node_3;
5166
INSERT INTO t1 VALUES (33);
5267
connection node_4;
68+
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
69+
EXPECT_4
70+
4
5371
INSERT INTO t1 VALUES (341);
5472
connection node_1;
55-
SELECT COUNT(*) = 19 FROM t1;
56-
COUNT(*) = 19
57-
1
73+
SELECT COUNT(*) AS EXPECT_19 FROM t1;
74+
EXPECT_19
75+
19
5876
connection node_2;
5977
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
6078
VARIABLE_VALUE = 4
6179
1
62-
SELECT COUNT(*) = 19 FROM t1;
63-
COUNT(*) = 19
64-
1
80+
SELECT COUNT(*) AS EXPECT_19 FROM t1;
81+
EXPECT_19
82+
19
6583
connection node_3;
6684
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
6785
VARIABLE_VALUE = 4
6886
1
69-
SELECT COUNT(*) = 19 FROM t1;
70-
COUNT(*) = 19
71-
1
87+
SELECT COUNT(*) AS EXPECT_19 FROM t1;
88+
EXPECT_19
89+
19
7290
connection node_4;
7391
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
7492
VARIABLE_VALUE = 4
7593
1
76-
SELECT COUNT(*) = 19 FROM t1;
77-
COUNT(*) = 19
78-
1
94+
SELECT COUNT(*) AS EXPECT_19 FROM t1;
95+
EXPECT_19
96+
19
7997
connection node_1;
8098
DROP TABLE t1;
8199
CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside");
@@ -86,5 +104,6 @@ CALL mtr.add_suppression("There are no nodes in the same segment that will ever
86104
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
87105
connection node_4;
88106
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
89-
disconnect node_2;
90-
disconnect node_1;
107+
connection node_1;
108+
disconnect node_3;
109+
disconnect node_4;

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

Lines changed: 34 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,93 +2,62 @@
22
# Test that autoincrement works correctly while the cluster membership
33
# is changing and SST takes place.
44
#
5-
65
--source include/big_test.inc
76
--source include/galera_cluster.inc
8-
--source include/have_innodb.inc
97
--source include/have_mariabackup.inc
8+
--source include/force_restart.inc
109

1110
--let $node_1=node_1
1211
--let $node_2=node_2
1312
--source include/auto_increment_offset_save.inc
1413

1514
--connection node_1
16-
--let $connection_id = `SELECT CONNECTION_ID()`
17-
1815
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
1916

20-
# Issue an endless stream of autoincrement inserts
21-
22-
DELIMITER |;
23-
CREATE PROCEDURE p1 ()
24-
BEGIN
25-
DECLARE x INT DEFAULT 1;
26-
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
27-
28-
WHILE 1 DO
29-
INSERT INTO t1 VALUES (DEFAULT);
30-
COMMIT;
31-
END WHILE;
32-
END|
33-
DELIMITER ;|
34-
35-
--send CALL p1();
36-
--sleep 1
37-
38-
--connection node_2
39-
--send CALL p1();
40-
--sleep 1
17+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
4118

4219
# Kill and restart node #2
43-
4420
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
4521
--connection node_2a
4622
--source include/kill_galera.inc
47-
4823
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
49-
--source include/start_mysqld.inc
50-
51-
INSERT INTO t1 VALUES (DEFAULT);
52-
53-
# Terminate the stored procedure
54-
55-
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
56-
--connection node_1a
57-
--disable_query_log
58-
--eval KILL CONNECTION $connection_id
59-
--enable_query_log
60-
INSERT INTO t1 VALUES (DEFAULT);
6124

6225
--connection node_1
63-
# CR_SERVER_LOST
64-
--error 2013,2006
65-
--reap
66-
67-
--connection node_2
68-
# CR_SERVER_LOST
69-
--error 2013,2006
70-
--reap
26+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
27+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
28+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
29+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
30+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
31+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
32+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
33+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
34+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
35+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
7136

72-
# Confirm that the count is correct and that the cluster is intact
37+
--connection node_2a
38+
--source include/start_mysqld.inc
39+
--source include/wait_until_connected_again.inc
40+
41+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
42+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
43+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
44+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
45+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
46+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
47+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
48+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
49+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
50+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
51+
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
7352

53+
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
7454
--connection node_1a
75-
--let $count = `SELECT COUNT(*) FROM t1`
55+
SELECT COUNT(*) FROM t1;
7656

7757
--connection node_2a
78-
--disable_query_log
79-
--eval SELECT COUNT(*) = $count AS count_equal FROM t1
80-
--enable_query_log
81-
82-
CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0");
83-
84-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
85-
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
86-
87-
--connection node_1a
88-
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
89-
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
58+
SELECT COUNT(*) FROM t1;
9059

91-
DROP PROCEDURE p1;
60+
--connection node_1
9261
DROP TABLE t1;
9362

9463
CALL mtr.add_suppression("gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)");
@@ -97,3 +66,6 @@ CALL mtr.add_suppression("WSREP: Action message in non-primary configuration fro
9766
--let $node_1=node_1a
9867
--let $node_2=node_2a
9968
--source include/auto_increment_offset_restore.inc
69+
70+
--disconnect node_1a
71+
--disconnect node_2a

0 commit comments

Comments
 (0)