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 /sql | |
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 'sql')
-rw-r--r-- | sql/sql_parse.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 033e88aa6e1..dadb03abfff 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1265,7 +1265,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, { wsrep_client_rollback(thd); } - if (thd->wsrep_conflict_state== ABORTED) + /* We let COM_QUIT and COM_STMT_CLOSE to execute even if wsrep aborted. */ + if (thd->wsrep_conflict_state == ABORTED && + command != COM_STMT_CLOSE && command != COM_QUIT) { my_error(ER_LOCK_DEADLOCK, MYF(0), "wsrep aborted transaction"); WSREP_DEBUG("Deadlock error for: %s", thd->query()); @@ -1918,6 +1920,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (WSREP(thd)) { + /* + MDEV-10812 + In the case of COM_QUIT/COM_STMT_CLOSE thread status should be disabled. + */ + DBUG_ASSERT((command != COM_QUIT && command != COM_STMT_CLOSE) + || thd->get_stmt_da()->is_disabled()); /* wsrep BF abort in query exec phase */ mysql_mutex_lock(&thd->LOCK_wsrep_thd); do_end_of_statement= thd->wsrep_conflict_state != REPLAYING && |