Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
038ffd2e
Commit
038ffd2e
authored
Mar 11, 2019
by
Leandro Pacheco
Committed by
Jan Lindström
Mar 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge pull request #1222 from codership/10.4-clear-sr-bugfix
MTR tests for clearing orphaned SR transactions in Galera
parent
15ccd390
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
367 additions
and
1 deletion
+367
-1
mysql-test/suite/galera_3nodes_sr/r/galera_sr_threeway_split_no_primary.result
...ra_3nodes_sr/r/galera_sr_threeway_split_no_primary.result
+85
-0
mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split_no_primary.test
...lera_3nodes_sr/t/galera_sr_threeway_split_no_primary.test
+126
-0
mysql-test/suite/galera_sr/r/galera_sr_cc_no_primary.result
mysql-test/suite/galera_sr/r/galera_sr_cc_no_primary.result
+70
-0
mysql-test/suite/galera_sr/t/galera_sr_cc_no_primary.test
mysql-test/suite/galera_sr/t/galera_sr_cc_no_primary.test
+85
-0
wsrep-lib
wsrep-lib
+1
-1
No files found.
mysql-test/suite/galera_3nodes_sr/r/galera_sr_threeway_split_no_primary.result
0 → 100644
View file @
038ffd2e
connection node_2;
connection node_1;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connect node_3a, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_1;
connection node_2;
connection node_3;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
SET SESSION wsrep_trx_fragment_size=1;
BEGIN;
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
connection node_2;
SET SESSION wsrep_trx_fragment_size=1;
BEGIN;
INSERT INTO t1 VALUES (21);
INSERT INTO t1 VALUES (22);
connection node_3;
SET SESSION wsrep_trx_fragment_size=1;
BEGIN;
INSERT INTO t1 VALUES (31);
INSERT INTO t1 VALUES (32);
connection node_2a;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
connection node_3a;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SET SESSION wsrep_sync_wait = DEFAULT;
connection node_2a;
SET SESSION wsrep_sync_wait = 0;
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SET SESSION wsrep_sync_wait = DEFAULT;
connection node_3a;
SET SESSION wsrep_sync_wait = 0;
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SET SESSION wsrep_sync_wait = DEFAULT;
connection node_2a;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
connection node_3a;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
connection node_1a;
connection node_2a;
connection node_3a;
connection node_1a;
SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log;
expect 0
0
INSERT INTO t1 VALUES(11);
INSERT INTO t1 VALUES(21);
INSERT INTO t1 VALUES(31);
SELECT * FROM t1;
f1
11
21
31
connection node_2a;
SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log;
expect 0
0
connection node_3a;
SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log;
expect 0
0
connection node_1;
INSERT INTO t1 VALUES(103);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2;
INSERT INTO t1 VALUES(203);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_3;
INSERT INTO t1 VALUES(303);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
DROP TABLE t1;
mysql-test/suite/galera_3nodes_sr/t/galera_sr_threeway_split_no_primary.test
0 → 100644
View file @
038ffd2e
#
# This test verifies that an orphaned SR gets cleanup upon cluster
# reconnection. Specifically, the case where the cluster goes through
# a state of no primary components, and the nodes rejoin with the
# same IDs.
#
--
source
include
/
galera_cluster
.
inc
--
connect
node_1a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_1
--
connect
node_2a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_2
--
connect
node_3
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_3
--
connect
node_3a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_3
# Save original auto_increment_offset values.
--
let
$node_1
=
node_1
--
let
$node_2
=
node_2
--
let
$node_3
=
node_3
--
source
../
galera
/
include
/
auto_increment_offset_save
.
inc
--
connection
node_1
CREATE
TABLE
t1
(
f1
INTEGER
PRIMARY
KEY
);
SET
SESSION
wsrep_trx_fragment_size
=
1
;
BEGIN
;
INSERT
INTO
t1
VALUES
(
11
);
INSERT
INTO
t1
VALUES
(
12
);
--
connection
node_2
SET
SESSION
wsrep_trx_fragment_size
=
1
;
BEGIN
;
INSERT
INTO
t1
VALUES
(
21
);
INSERT
INTO
t1
VALUES
(
22
);
--
connection
node_3
SET
SESSION
wsrep_trx_fragment_size
=
1
;
BEGIN
;
INSERT
INTO
t1
VALUES
(
31
);
INSERT
INTO
t1
VALUES
(
32
);
--
connection
node_2a
SET
GLOBAL
wsrep_provider_options
=
'gmcast.isolate = 1'
;
--
connection
node_3a
SET
GLOBAL
wsrep_provider_options
=
'gmcast.isolate = 1'
;
--
connection
node_1a
# wait until cluster is partitioned
SET
SESSION
wsrep_sync_wait
=
0
;
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
1
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
--
source
include
/
wait_condition
.
inc
SHOW
STATUS
LIKE
'wsrep_cluster_status'
;
SET
SESSION
wsrep_sync_wait
=
DEFAULT
;
--
connection
node_2a
# wait until cluster is partitioned
SET
SESSION
wsrep_sync_wait
=
0
;
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
1
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
--
source
include
/
wait_condition
.
inc
SHOW
STATUS
LIKE
'wsrep_cluster_status'
;
SET
SESSION
wsrep_sync_wait
=
DEFAULT
;
--
connection
node_3a
# wait until cluster is partitioned
SET
SESSION
wsrep_sync_wait
=
0
;
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
1
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
--
source
include
/
wait_condition
.
inc
SHOW
STATUS
LIKE
'wsrep_cluster_status'
;
SET
SESSION
wsrep_sync_wait
=
DEFAULT
;
--
connection
node_2a
# reconnect node 2
SET
GLOBAL
wsrep_provider_options
=
'gmcast.isolate = 0'
;
--
connection
node_3a
# reconnect node 3
SET
GLOBAL
wsrep_provider_options
=
'gmcast.isolate = 0'
;
# wait for the cluster to whole again
--
connection
node_1a
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
3
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
--
source
include
/
wait_condition
.
inc
--
source
include
/
galera_wait_ready
.
inc
--
connection
node_2a
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
3
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
--
source
include
/
wait_condition
.
inc
--
source
include
/
galera_wait_ready
.
inc
--
connection
node_3a
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
3
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_cluster_size'
--
source
include
/
wait_condition
.
inc
--
source
include
/
galera_wait_ready
.
inc
--
connection
node_1a
# check that the streaming log has been cleared and there are no locks
# from the SRs by issuing conflicting inserts
SELECT
COUNT
(
*
)
`expect 0`
FROM
mysql
.
wsrep_streaming_log
;
INSERT
INTO
t1
VALUES
(
11
);
INSERT
INTO
t1
VALUES
(
21
);
INSERT
INTO
t1
VALUES
(
31
);
SELECT
*
FROM
t1
;
--
connection
node_2a
SELECT
COUNT
(
*
)
`expect 0`
FROM
mysql
.
wsrep_streaming_log
;
--
connection
node_3a
SELECT
COUNT
(
*
)
`expect 0`
FROM
mysql
.
wsrep_streaming_log
;
# check that all 3 SRs have been rolled back
--
connection
node_1
--
error
ER_LOCK_DEADLOCK
INSERT
INTO
t1
VALUES
(
103
);
--
connection
node_2
--
error
ER_LOCK_DEADLOCK
INSERT
INTO
t1
VALUES
(
203
);
--
connection
node_3
--
error
ER_LOCK_DEADLOCK
INSERT
INTO
t1
VALUES
(
303
);
--
connection
node_1
DROP
TABLE
t1
;
# Restore original auto_increment_offset values.
--
source
../
galera
/
include
/
auto_increment_offset_restore
.
inc
mysql-test/suite/galera_sr/r/galera_sr_cc_no_primary.result
0 → 100644
View file @
038ffd2e
connection node_2;
connection node_1;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_1;
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
SET SESSION wsrep_trx_fragment_size=1;
BEGIN;
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
connection node_2;
SET SESSION wsrep_trx_fragment_size=1;
BEGIN;
INSERT INTO t1 VALUES (20);
INSERT INTO t1 VALUES (21);
INSERT INTO t1 VALUES (22);
SELECT COUNT(*) `expect 6` FROM mysql.wsrep_streaming_log;
expect 6
6
connection node_2a;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
SET SESSION wsrep_sync_wait = 0;
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 1
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SET SESSION wsrep_sync_wait = DEFAULT;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 1
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SET SESSION wsrep_sync_wait = DEFAULT;
connection node_2a;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 2
connection node_1a;
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 2
SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log;
expect 0
0
connection node_2a;
SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log;
expect 0
0
INSERT INTO t1 VALUES(10);
INSERT INTO t1 VALUES(20);
SELECT * FROM t1;
f1
10
20
connection node_1;
INSERT INTO t1 VALUES(13);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2;
INSERT INTO t1 VALUES(23);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
mysql-test/suite/galera_sr/t/galera_sr_cc_no_primary.test
0 → 100644
View file @
038ffd2e
#
# This test verifies that an orphaned SR gets cleanup upon cluster
# reconnection. Specifically, the case where the cluster goes through
# a state of no primary components, and the nodes rejoin with the
# same IDs.
#
--
source
include
/
galera_cluster
.
inc
--
connect
node_1a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_1
--
connect
node_2a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_2
# Save original auto_increment_offset values.
--
let
$node_1
=
node_1
--
let
$node_2
=
node_2
--
source
../
galera
/
include
/
auto_increment_offset_save
.
inc
--
connection
node_1
CREATE
TABLE
t1
(
f1
INTEGER
PRIMARY
KEY
);
SET
SESSION
wsrep_trx_fragment_size
=
1
;
BEGIN
;
INSERT
INTO
t1
VALUES
(
10
);
INSERT
INTO
t1
VALUES
(
11
);
INSERT
INTO
t1
VALUES
(
12
);
--
connection
node_2
SET
SESSION
wsrep_trx_fragment_size
=
1
;
BEGIN
;
INSERT
INTO
t1
VALUES
(
20
);
INSERT
INTO
t1
VALUES
(
21
);
INSERT
INTO
t1
VALUES
(
22
);
SELECT
COUNT
(
*
)
`expect 6`
FROM
mysql
.
wsrep_streaming_log
;
# isolate node 2
--
connection
node_2a
SET
GLOBAL
wsrep_provider_options
=
'gmcast.isolate = 1'
;
SET
SESSION
wsrep_sync_wait
=
0
;
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
'OFF'
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_ready'
--
source
include
/
wait_condition
.
inc
SHOW
STATUS
LIKE
'wsrep_cluster_size'
;
SHOW
STATUS
LIKE
'wsrep_cluster_status'
;
SET
SESSION
wsrep_sync_wait
=
DEFAULT
;
--
connection
node_1a
SET
SESSION
wsrep_sync_wait
=
0
;
--
let
$wait_condition
=
SELECT
VARIABLE_VALUE
=
'OFF'
FROM
INFORMATION_SCHEMA
.
GLOBAL_STATUS
WHERE
VARIABLE_NAME
=
'wsrep_ready'
--
source
include
/
wait_condition
.
inc
SHOW
STATUS
LIKE
'wsrep_cluster_size'
;
SHOW
STATUS
LIKE
'wsrep_cluster_status'
;
SET
SESSION
wsrep_sync_wait
=
DEFAULT
;
--
connection
node_2a
# reconnect node 2
SET
GLOBAL
wsrep_provider_options
=
'gmcast.isolate = 0'
;
--
source
include
/
galera_wait_ready
.
inc
SHOW
STATUS
LIKE
'wsrep_cluster_size'
;
--
connection
node_1a
# wait for reconnection and check that the streaming log has been cleared
--
source
include
/
galera_wait_ready
.
inc
SHOW
STATUS
LIKE
'wsrep_cluster_size'
;
SELECT
COUNT
(
*
)
`expect 0`
FROM
mysql
.
wsrep_streaming_log
;
--
connection
node_2a
# check that the streaming log has been cleared and there are no locks
# from the SRs by issuing conflicting inserts
SELECT
COUNT
(
*
)
`expect 0`
FROM
mysql
.
wsrep_streaming_log
;
INSERT
INTO
t1
VALUES
(
10
);
INSERT
INTO
t1
VALUES
(
20
);
SELECT
*
FROM
t1
;
# check that both SRs have been rolled back
--
connection
node_1
--
error
ER_LOCK_DEADLOCK
INSERT
INTO
t1
VALUES
(
13
);
--
connection
node_2
--
error
ER_LOCK_DEADLOCK
INSERT
INTO
t1
VALUES
(
23
);
DROP
TABLE
t1
;
# Restore original auto_increment_offset values.
--
source
../
galera
/
include
/
auto_increment_offset_restore
.
inc
wsrep-lib
@
ae746fb2
Subproject commit
badf53a28d2273741c449df0aa5fa6db67561466
Subproject commit
ae746fb28957140fb996a4aaf994baea58bd5287
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment