diff options
author | Sachin Setiya <sachin.setiya@mariadb.com> | 2017-01-27 11:15:45 +0530 |
---|---|---|
committer | Sachin Setiya <sachin.setiya@mariadb.com> | 2017-01-31 13:34:49 +0530 |
commit | 41997d148dc1999c202f14e82e172c1ff57c7ead (patch) | |
tree | ab0507ff98ff796a0135563fb17d77f3092852bf /mysql-test/suite/galera | |
parent | bb1e8e43672ecf47e99970b5b96f65d101bae752 (diff) | |
download | mariadb-git-41997d148dc1999c202f14e82e172c1ff57c7ead.tar.gz |
MDEV-10812 WSREP causes responses being sent to protocol commands
that must not send a response
Problem:- When using wsrep (w/ galera) and issuing commands that can
cause deadlocks, deadlock exception errors are sent in responses to
commands such as close prepared statement and close connection which,
by spec, must not send a response.
Solution:- In dispatch_command, we will handle COM_QUIT and COM_STMT_CLOSE
commands even in case of error.
Patch Credit:- Jaka Močnik
Diffstat (limited to 'mysql-test/suite/galera')
-rw-r--r-- | mysql-test/suite/galera/r/galera_mdev_10812.result | 11 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/galera_mdev_10812.test | 27 |
2 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/r/galera_mdev_10812.result b/mysql-test/suite/galera/r/galera_mdev_10812.result new file mode 100644 index 00000000000..fba10004761 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_mdev_10812.result @@ -0,0 +1,11 @@ +# +# MDEV-10812: On COM_STMT_CLOSE/COM_QUIT, when wsrep_conflict_state +# is ABORTED, it causes wrong response to be sent to the client +# +SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; +CREATE TABLE t1(a INT PRIMARY KEY); +INSERT INTO t1 VALUES(1),(2),(3); +START TRANSACTION ; +UPDATE t1 SET a=a+100; +UPDATE t1 SET a=a+100; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_mdev_10812.test b/mysql-test/suite/galera/t/galera_mdev_10812.test new file mode 100644 index 00000000000..4539ab6c84d --- /dev/null +++ b/mysql-test/suite/galera/t/galera_mdev_10812.test @@ -0,0 +1,27 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--echo # +--echo # MDEV-10812: On COM_STMT_CLOSE/COM_QUIT, when wsrep_conflict_state +--echo # is ABORTED, it causes wrong response to be sent to the client +--echo # + +# First create a deadlock +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; +CREATE TABLE t1(a INT PRIMARY KEY); +INSERT INTO t1 VALUES(1),(2),(3); +START TRANSACTION ; +UPDATE t1 SET a=a+100; + +--sleep 2 +--connection node_2 +UPDATE t1 SET a=a+100; + +--sleep 2 +--connection node_1a +# here we get deadlock error +--disconnect node_1a + +--connection node_2 +DROP TABLE t1; |