Skip to content

Commit 0796b7a

Browse files
committed
Merge 10.6 into 10.9
2 parents 2f9e264 + eb2e074 commit 0796b7a

37 files changed

+640
-301
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ variables:
4242
CMAKE_FLAGS: "-DWITH_SSL=system -DPLUGIN_COLUMNSTORE=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_S3=NO -DPLUGIN_MROONGA=NO -DPLUGIN_CONNECT=NO -DPLUGIN_MROONGA=NO -DPLUGIN_TOKUDB=NO -DPLUGIN_PERFSCHEMA=NO -DWITH_WSREP=OFF"
4343
# Major version dictates which branches share the same ccache. E.g. 10.6-abc
4444
# and 10.6-xyz will have the same cache.
45-
MARIADB_MAJOR_VERSION: "10.8"
45+
MARIADB_MAJOR_VERSION: "10.9"
4646
# NOTE! Currently ccache is only used on the Centos8 build. As each job has
4747
# sufficiently different environments they are unable to benefit from each
4848
# other's ccaches. As each build generates about 1 GB of ccache, having

include/mysql/service_wsrep.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ extern struct wsrep_service_st {
5757
my_bool (*wsrep_on_func)(const MYSQL_THD thd);
5858
bool (*wsrep_prepare_key_for_innodb_func)(MYSQL_THD thd, const unsigned char*, size_t, const unsigned char*, size_t, struct wsrep_buf*, size_t*);
5959
void (*wsrep_thd_LOCK_func)(const MYSQL_THD thd);
60+
int (*wsrep_thd_TRYLOCK_func)(const MYSQL_THD thd);
6061
void (*wsrep_thd_UNLOCK_func)(const MYSQL_THD thd);
6162
const char * (*wsrep_thd_query_func)(const MYSQL_THD thd);
6263
int (*wsrep_thd_retry_counter_func)(const MYSQL_THD thd);
@@ -89,7 +90,6 @@ extern struct wsrep_service_st {
8990
ulong (*wsrep_OSU_method_get_func)(const MYSQL_THD thd);
9091
my_bool (*wsrep_thd_has_ignored_error_func)(const MYSQL_THD thd);
9192
void (*wsrep_thd_set_ignored_error_func)(MYSQL_THD thd, my_bool val);
92-
bool (*wsrep_thd_set_wsrep_aborter_func)(MYSQL_THD bf_thd, MYSQL_THD thd);
9393
void (*wsrep_report_bf_lock_wait_func)(const MYSQL_THD thd,
9494
unsigned long long trx_id);
9595
void (*wsrep_thd_kill_LOCK_func)(const MYSQL_THD thd);
@@ -111,6 +111,7 @@ extern struct wsrep_service_st {
111111
#define wsrep_on(thd) (thd) && WSREP_ON && wsrep_service->wsrep_on_func(thd)
112112
#define wsrep_prepare_key_for_innodb(A,B,C,D,E,F,G) wsrep_service->wsrep_prepare_key_for_innodb_func(A,B,C,D,E,F,G)
113113
#define wsrep_thd_LOCK(T) wsrep_service->wsrep_thd_LOCK_func(T)
114+
#define wsrep_thd_TRYLOCK(T) wsrep_service->wsrep_thd_TRYLOCK_func(T)
114115
#define wsrep_thd_UNLOCK(T) wsrep_service->wsrep_thd_UNLOCK_func(T)
115116
#define wsrep_thd_kill_LOCK(T) wsrep_service->wsrep_thd_kill_LOCK_func(T)
116117
#define wsrep_thd_kill_UNLOCK(T) wsrep_service->wsrep_thd_kill_UNLOCK_func(T)
@@ -141,7 +142,6 @@ extern struct wsrep_service_st {
141142
#define wsrep_OSU_method_get(T) wsrep_service->wsrep_OSU_method_get_func(T)
142143
#define wsrep_thd_has_ignored_error(T) wsrep_service->wsrep_thd_has_ignored_error_func(T)
143144
#define wsrep_thd_set_ignored_error(T,V) wsrep_service->wsrep_thd_set_ignored_error_func(T,V)
144-
#define wsrep_thd_set_wsrep_aborter(T) wsrep_service->wsrep_thd_set_wsrep_aborter_func(T1, T2)
145145
#define wsrep_report_bf_lock_wait(T,I) wsrep_service->wsrep_report_bf_lock_wait(T,I)
146146
#define wsrep_thd_set_PA_unsafe(T) wsrep_service->wsrep_thd_set_PA_unsafe_func(T)
147147
#else
@@ -175,6 +175,8 @@ void wsrep_set_data_home_dir(const char *data_dir);
175175
extern "C" my_bool wsrep_on(const MYSQL_THD thd);
176176
/* Lock thd wsrep lock */
177177
extern "C" void wsrep_thd_LOCK(const MYSQL_THD thd);
178+
/* Try thd wsrep lock. Return non-zero if lock could not be taken. */
179+
extern "C" int wsrep_thd_TRYLOCK(const MYSQL_THD thd);
178180
/* Unlock thd wsrep lock */
179181
extern "C" void wsrep_thd_UNLOCK(const MYSQL_THD thd);
180182

@@ -197,8 +199,6 @@ extern "C" my_bool wsrep_thd_is_local(const MYSQL_THD thd);
197199
/* Return true if thd is in high priority mode */
198200
/* todo: rename to is_high_priority() */
199201
extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
200-
/* set wsrep_aborter for the target THD */
201-
extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd);
202202
/* Return true if thd is in TOI mode */
203203
extern "C" my_bool wsrep_thd_is_toi(const MYSQL_THD thd);
204204
/* Return true if thd is in replicating TOI mode */
@@ -249,7 +249,6 @@ extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
249249
extern "C" ulong wsrep_OSU_method_get(const MYSQL_THD thd);
250250
extern "C" my_bool wsrep_thd_has_ignored_error(const MYSQL_THD thd);
251251
extern "C" void wsrep_thd_set_ignored_error(MYSQL_THD thd, my_bool val);
252-
extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd);
253252
extern "C" void wsrep_report_bf_lock_wait(const THD *thd,
254253
unsigned long long trx_id);
255254
/* declare parallel applying unsafety for the THD */

mysql-test/suite/galera/disabled.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ galera_bf_kill_debug : timeout after 900 seconds
2727
galera_ssl_upgrade : [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 130: Incorrect file format 'gtid_slave_pos'
2828
galera_parallel_simple : timeout related to wsrep_sync_wait
2929
galera_insert_bulk : MDEV-30536 no expected deadlock in galera_insert_bulk test
30+
MDEV-27713 : test is using get_lock(), which is now rejected in cluster
31+
galera_bf_abort_group_commit : MDEV-30855 PR to remove the test exists
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
connection node_2;
2+
connection node_1;
3+
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
4+
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
5+
set wsrep_sync_wait = 0;
6+
CREATE TABLE t1(a int not null primary key auto_increment, b int) engine=InnoDB;
7+
INSERT INTO t1 VALUES (1,2);
8+
connection node_1a;
9+
BEGIN;
10+
UPDATE t1 SET b=3 WHERE a=1;
11+
connection node_1;
12+
set debug_sync='wsrep_kill_before_awake_no_mutex SIGNAL before_kill WAIT_FOR continue';
13+
connection node_1b;
14+
set debug_sync= 'now WAIT_FOR before_kill';
15+
connection node_2;
16+
UPDATE t1 SET b=7 WHERE a=1;
17+
connection node_1b;
18+
set debug_sync= 'now SIGNAL continue';
19+
connection node_1;
20+
DROP TABLE t1;
21+
SET DEBUG_SYNC= 'RESET';

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
8282
LOCK TABLE t2 WRITE;
8383
connection node_1;
8484
CREATE TABLE t1 AS SELECT * FROM t2;;
85+
connection node_1a;
8586
connection node_2;
8687
SELECT COUNT(*) = 5 FROM t2;
8788
COUNT(*) = 5

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,3 @@ connection node_1;
134134
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
135135
CALL mtr.add_suppression("conflict state 7 after post commit");
136136
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
137-
connection node_2;
138-
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
139-
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
connection node_2;
2+
connection node_1;
3+
connect node_1_kill, 127.0.0.1, root, , test, $NODE_MYPORT_1;
4+
connect node_1_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
5+
SET SESSION wsrep_sync_wait = 0;
6+
connect node_1_follower, 127.0.0.1, root, , test, $NODE_MYPORT_1;
7+
SET SESSION wsrep_sync_wait = 0;
8+
connection node_1;
9+
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
10+
SET SESSION DEBUG_SYNC = "commit_before_enqueue SIGNAL leader_before_enqueue_reached WAIT_FOR leader_before_enqueue_continue";
11+
INSERT INTO t1 VALUES (1);
12+
connection node_1_ctrl;
13+
SET DEBUG_SYNC = "now WAIT_FOR leader_before_enqueue_reached";
14+
connection node_1_follower;
15+
INSERT INTO t1 VALUES (2);;
16+
connection node_1_ctrl;
17+
connection node_1_kill;
18+
# Execute KILL QUERY for group commit follower
19+
SET DEBUG_SYNC = "now SIGNAL leader_before_enqueue_continue";
20+
connection node_1_follower;
21+
connection node_1;
22+
SELECT * FROM t1;
23+
f1
24+
1
25+
2
26+
SET DEBUG_SYNC = "RESET";
27+
DROP TABLE t1;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue';
3636
connection node_1;
3737
SELECT COUNT(*) FROM t1;
3838
COUNT(*)
39-
1
39+
connection node_1;
40+
SELECT COUNT(*) FROM t1;
41+
COUNT(*)
42+
0
4043
SET DEBUG_SYNC = 'RESET';
4144
SET GLOBAL debug_dbug = NULL;
4245
DROP TABLE t1;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
--source include/galera_cluster.inc
2+
--source include/have_innodb.inc
3+
--source include/have_debug_sync.inc
4+
--source include/galera_have_debug_sync.inc
5+
6+
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
7+
--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
8+
set wsrep_sync_wait = 0;
9+
10+
CREATE TABLE t1(a int not null primary key auto_increment, b int) engine=InnoDB;
11+
INSERT INTO t1 VALUES (1,2);
12+
13+
--connection node_1a
14+
--let $victim_id = `SELECT CONNECTION_ID()`
15+
BEGIN;
16+
UPDATE t1 SET b=3 WHERE a=1;
17+
18+
--connection node_1
19+
set debug_sync='wsrep_kill_before_awake_no_mutex SIGNAL before_kill WAIT_FOR continue';
20+
--disable_query_log
21+
--disable_result_log
22+
--send_eval KILL CONNECTION $victim_id
23+
--enable_result_log
24+
--enable_query_log
25+
26+
--connection node_1b
27+
set debug_sync= 'now WAIT_FOR before_kill';
28+
29+
--connection node_2
30+
UPDATE t1 SET b=7 WHERE a=1;
31+
32+
--connection node_1b
33+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE User = 'system user' AND State LIKE 'Update_rows_log_event%';
34+
--source include/wait_condition.inc
35+
set debug_sync= 'now SIGNAL continue';
36+
37+
--connection node_1
38+
--reap
39+
DROP TABLE t1;
40+
SET DEBUG_SYNC= 'RESET';
41+

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ LOCK TABLE t2 WRITE;
113113
--connection node_1
114114
--send CREATE TABLE t1 AS SELECT * FROM t2;
115115

116+
--connection node_1a
117+
--let $wait_condition = SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE STATE LIKE 'Waiting for table metadata lock%'
118+
--source include/wait_condition.inc
119+
116120
--connection node_2
117121
SELECT COUNT(*) = 5 FROM t2;
118122
CREATE TABLE t1 AS SELECT * FROM t2;
@@ -121,7 +125,7 @@ CREATE TABLE t1 AS SELECT * FROM t2;
121125
UNLOCK TABLES;
122126

123127
--connection node_1
124-
--error ER_TABLE_EXISTS_ERROR,ER_LOCK_DEADLOCK
128+
--error ER_TABLE_EXISTS_ERROR,ER_QUERY_INTERRUPTED
125129
--reap
126130

127131
DROP TABLE t1, t2;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
!include ../galera_2nodes.cnf
2+
3+
[mysqld]
4+
log-bin
5+
log-slave-updates
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#
2+
# Verify that transaction which has reached group commit queue
3+
# cannot be killed. If the kill succeeds, assertion for
4+
# wsrep transaction state will fail.
5+
#
6+
# If the bug is present, i.e. wsrep transaction gets killed during
7+
# group commit wait, this test is enough to reproduce the crash
8+
# most of the time.
9+
#
10+
11+
--source include/have_innodb.inc
12+
--source include/have_debug_sync.inc
13+
--source include/galera_cluster.inc
14+
15+
# Connection for KILL commands
16+
--connect node_1_kill, 127.0.0.1, root, , test, $NODE_MYPORT_1
17+
# Connection for sync point control
18+
--connect node_1_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1
19+
SET SESSION wsrep_sync_wait = 0;
20+
# Connection for group commit follower
21+
--connect node_1_follower, 127.0.0.1, root, , test, $NODE_MYPORT_1
22+
# Need to disable sync wait to reach commit queue when leader
23+
# is blocked.
24+
SET SESSION wsrep_sync_wait = 0;
25+
--let $follower_id = `SELECT CONNECTION_ID()`
26+
27+
--connection node_1
28+
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
29+
30+
SET SESSION DEBUG_SYNC = "commit_before_enqueue SIGNAL leader_before_enqueue_reached WAIT_FOR leader_before_enqueue_continue";
31+
--send INSERT INTO t1 VALUES (1)
32+
33+
--connection node_1_ctrl
34+
SET DEBUG_SYNC = "now WAIT_FOR leader_before_enqueue_reached";
35+
36+
--connection node_1_follower
37+
# SET SESSION DEBUG_SYNC = "group_commit_waiting_for_prior SIGNAL follower_waiting_for_prior_reached WAIT_FOR follower_waiting_for_prior_continue";
38+
--send INSERT INTO t1 VALUES (2);
39+
40+
--connection node_1_ctrl
41+
# TODO: Is it possible to use sync points to enforce group commit to happen?
42+
# The leader will hold commit monitor in commit_before_enqueue sync point,
43+
# which prevents the follower to reach the group commit wait state.
44+
# We now sleep and expect the follower to reach group commit, but this
45+
# may cause false negatives.
46+
--sleep 1
47+
48+
--connection node_1_kill
49+
--echo # Execute KILL QUERY for group commit follower
50+
--disable_query_log
51+
--disable_result_log
52+
# Because it is currently impossible to verify that the
53+
# follower has reached group commit queue, the KILL may
54+
# sometimes return success.
55+
--error 0,ER_KILL_DENIED_ERROR
56+
--eval KILL QUERY $follower_id
57+
--enable_result_log
58+
--enable_query_log
59+
60+
SET DEBUG_SYNC = "now SIGNAL leader_before_enqueue_continue";
61+
--connection node_1_follower
62+
--reap
63+
64+
--connection node_1
65+
--reap
66+
SELECT * FROM t1;
67+
68+
SET DEBUG_SYNC = "RESET";
69+
DROP TABLE t1;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ SELECT COUNT(*) FROM t1;
6464
SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue';
6565

6666
--connection node_1
67+
--error 0,ER_LOCK_DEADLOCK
6768
--reap
6869
SELECT COUNT(*) FROM t1;
6970

0 commit comments

Comments
 (0)