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
66916bba
Commit
66916bba
authored
Dec 16, 2016
by
Philip Stoev
Committed by
Sachin Setiya
Apr 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Galera MTR Tests: Tests for MW-328 Fix unnecessary/silent BF aborts
parent
97a3a07c
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
336 additions
and
0 deletions
+336
-0
mysql-test/suite/galera/r/MW-328A.result
mysql-test/suite/galera/r/MW-328A.result
+21
-0
mysql-test/suite/galera/r/MW-328B.result
mysql-test/suite/galera/r/MW-328B.result
+17
-0
mysql-test/suite/galera/r/MW-328C.result
mysql-test/suite/galera/r/MW-328C.result
+17
-0
mysql-test/suite/galera/r/MW-328D.result
mysql-test/suite/galera/r/MW-328D.result
+15
-0
mysql-test/suite/galera/r/MW-328E.result
mysql-test/suite/galera/r/MW-328E.result
+15
-0
mysql-test/suite/galera/t/MW-328-footer.inc
mysql-test/suite/galera/t/MW-328-footer.inc
+18
-0
mysql-test/suite/galera/t/MW-328-header.inc
mysql-test/suite/galera/t/MW-328-header.inc
+29
-0
mysql-test/suite/galera/t/MW-328A.test
mysql-test/suite/galera/t/MW-328A.test
+55
-0
mysql-test/suite/galera/t/MW-328B.test
mysql-test/suite/galera/t/MW-328B.test
+35
-0
mysql-test/suite/galera/t/MW-328C.test
mysql-test/suite/galera/t/MW-328C.test
+35
-0
mysql-test/suite/galera/t/MW-328D.test
mysql-test/suite/galera/t/MW-328D.test
+39
-0
mysql-test/suite/galera/t/MW-328E.test
mysql-test/suite/galera/t/MW-328E.test
+40
-0
No files found.
mysql-test/suite/galera/r/MW-328A.result
0 → 100644
View file @
66916bba
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
CALL proc_update();;
SET SESSION wsrep_retry_autocommit = 0;
have_successes
1
have_deadlocks
1
Got one of the listed errors
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
mysql-test/suite/galera/r/MW-328B.result
0 → 100644
View file @
66916bba
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
CALL proc_update();;
SET SESSION wsrep_retry_autocommit = 0;
Got one of the listed errors
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
mysql-test/suite/galera/r/MW-328C.result
0 → 100644
View file @
66916bba
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
CALL proc_update();;
SET SESSION wsrep_retry_autocommit = 10000;
Got one of the listed errors
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
mysql-test/suite/galera/r/MW-328D.result
0 → 100644
View file @
66916bba
CREATE TABLE t1 (i INT) ENGINE = InnoDB;
INSERT INTO t1 (i) VALUES(1);
CREATE TABLE t2 (i INT) ENGINE = InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE;
i
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;;
DELETE FROM t1 WHERE i = 1;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1, t2;
mysql-test/suite/galera/r/MW-328E.result
0 → 100644
View file @
66916bba
create table t1 (i int primary key, j int) engine=innodb;
create table t2 (i int primary key, j int) engine=innodb;
insert into t1 values (1,0);
insert into t2 values (2,0);
set autocommit=off;
start transaction;
update t1 set j=1 where i=1;
set autocommit=off;
start transaction;
begin;
update t2 set j=1 where i=2;
insert into t1 select * from t2;;
insert into t2 select * from t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1, t2;
mysql-test/suite/galera/t/MW-328-footer.inc
0 → 100644
View file @
66916bba
#
# Cleanup for MW-328 tests
#
--
connection
node_1
--
disable_query_log
--
eval
KILL
CONNECTION
$sp_connection_id
--
enable_query_log
--
connection
node_1X
--
error
2013
,
1317
--
reap
--
connection
node_1
DROP
PROCEDURE
proc_update
;
DROP
TABLE
t1
,
t2
;
CALL
mtr
.
add_suppression
(
"conflict state 3 after post commit"
);
mysql-test/suite/galera/t/MW-328-header.inc
0 → 100644
View file @
66916bba
#
# Initialization for MW-328 tests
#
CREATE
TABLE
t1
(
f1
INTEGER
AUTO_INCREMENT
PRIMARY
KEY
,
f2
CHAR
(
20
)
DEFAULT
'abc'
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
(
f1
)
VALUES
(
1
);
CREATE
TABLE
t2
(
f1
CHAR
(
20
))
ENGINE
=
InnoDB
;
#
# Have some random updates going on against t1
#
DELIMITER
|
;
CREATE
PROCEDURE
proc_update
()
BEGIN
DECLARE
CONTINUE
HANDLER
FOR
SQLEXCEPTION
BEGIN
END
;
SET
SESSION
wsrep_sync_wait
=
0
;
WHILE
1
DO
UPDATE
t1
SET
f2
=
LEFT
(
MD5
(
RAND
()),
4
);
END
WHILE
;
END
|
DELIMITER
;
|
--
connect
node_1X
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_1
--
connection
node_1X
--
let
$sp_connection_id
=
`SELECT CONNECTION_ID()`
--
send
CALL
proc_update
();
mysql-test/suite/galera/t/MW-328A.test
0 → 100644
View file @
66916bba
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Attempt to insert into t2 and check if insert actually inserted rows if
# a success was reported.
#
--
source
include
/
galera_cluster
.
inc
--
source
suite
/
galera
/
t
/
MW
-
328
-
header
.
inc
--
connection
node_2
--
let
$count
=
100
--
let
$successes
=
0
--
let
$deadlocks
=
0
SET
SESSION
wsrep_retry_autocommit
=
0
;
--
disable_query_log
while
(
$count
)
{
TRUNCATE
TABLE
t2
;
--
error
0
,
1213
INSERT
IGNORE
INTO
t2
SELECT
f2
FROM
t1
;
if
(
$mysql_errno
!=
1213
)
{
--
inc
$successes
if
(
`SELECT COUNT(*) = 0 FROM t2`
)
{
--
die
No
rows
arrived
in
table
t2
}
}
if
(
$mysql_errno
==
1213
)
{
--
inc
$deadlocks
}
--
dec
$count
}
--
enable_query_log
#
# Check that the test produced both deadlocks and successes
#
--
disable_query_log
--
eval
SELECT
$successes
>
0
AS
have_successes
--
eval
SELECT
$deadlocks
>
0
AS
have_deadlocks
--
enable_query_log
--
source
suite
/
galera
/
t
/
MW
-
328
-
footer
.
inc
mysql-test/suite/galera/t/MW-328B.test
0 → 100644
View file @
66916bba
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Make sure an unrelated SELECT following a BF-aborted query never
# gets the deadlock error
#
--
source
include
/
galera_cluster
.
inc
--
source
suite
/
galera
/
t
/
MW
-
328
-
header
.
inc
--
connection
node_2
--
let
$count
=
100
SET
SESSION
wsrep_retry_autocommit
=
0
;
--
disable_query_log
while
(
$count
)
{
--
error
0
,
1213
INSERT
IGNORE
INTO
t2
SELECT
f2
FROM
t1
;
--
disable_result_log
--
error
0
SELECT
1
FROM
DUAL
;
--
enable_result_log
--
dec
$count
}
--
enable_query_log
--
source
suite
/
galera
/
t
/
MW
-
328
-
footer
.
inc
mysql-test/suite/galera/t/MW-328C.test
0 → 100644
View file @
66916bba
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Make sure that a high value of wsrep_retry_autocommit
# masks all deadlock errors
#
--
source
include
/
galera_cluster
.
inc
--
source
suite
/
galera
/
t
/
MW
-
328
-
header
.
inc
--
connection
node_2
--
let
$count
=
100
SET
SESSION
wsrep_retry_autocommit
=
10000
;
--
disable_query_log
while
(
$count
)
{
--
error
0
INSERT
IGNORE
INTO
t2
SELECT
f2
FROM
t1
;
--
disable_result_log
--
error
0
SELECT
1
FROM
DUAL
;
--
enable_result_log
--
dec
$count
}
--
enable_query_log
--
source
suite
/
galera
/
t
/
MW
-
328
-
footer
.
inc
mysql-test/suite/galera/t/MW-328D.test
0 → 100644
View file @
66916bba
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Test that non-Galera deadlock error still behaves as expected
#
--
source
include
/
galera_cluster
.
inc
CREATE
TABLE
t1
(
i
INT
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
(
i
)
VALUES
(
1
);
CREATE
TABLE
t2
(
i
INT
)
ENGINE
=
InnoDB
;
# Create a deadlock situation
--
connection
node_1
SET
AUTOCOMMIT
=
OFF
;
START
TRANSACTION
;
SELECT
*
FROM
t1
WHERE
i
=
1
LOCK
IN
SHARE
MODE
;
--
connect
node_1a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_1
--
connection
node_1a
SET
AUTOCOMMIT
=
OFF
;
START
TRANSACTION
;
--
send
INSERT
IGNORE
INTO
t2
SELECT
*
FROM
t1
WHERE
i
=
1
FOR
UPDATE
;
--
connection
node_1
--
sleep
2
DELETE
FROM
t1
WHERE
i
=
1
;
COMMIT
;
# We expect that ER_LOCK_DEADLOCK will be delivered even though it was a INSERT INGORE statement
--
connection
node_1a
--
error
ER_LOCK_DEADLOCK
--
reap
DROP
TABLE
t1
,
t2
;
mysql-test/suite/galera/t/MW-328E.test
0 → 100644
View file @
66916bba
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Test that non-Galera deadlock error still behaves as expected (case #2)
#
--
source
include
/
galera_cluster
.
inc
create
table
t1
(
i
int
primary
key
,
j
int
)
engine
=
innodb
;
create
table
t2
(
i
int
primary
key
,
j
int
)
engine
=
innodb
;
insert
into
t1
values
(
1
,
0
);
insert
into
t2
values
(
2
,
0
);
set
autocommit
=
off
;
start
transaction
;
update
t1
set
j
=
1
where
i
=
1
;
--
connect
node_1a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_1
--
connection
node_1a
set
autocommit
=
off
;
start
transaction
;
begin
;
update
t2
set
j
=
1
where
i
=
2
;
--
connection
node_1
# Hang expected here
--
send
insert
into
t1
select
*
from
t2
;
--
sleep
2
--
connection
node_1a
--
error
ER_LOCK_DEADLOCK
insert
into
t2
select
*
from
t1
;
--
connection
node_1
--
reap
DROP
TABLE
t1
,
t2
;
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