summaryrefslogtreecommitdiff
path: root/sql/wsrep_trans_observer.h
diff options
context:
space:
mode:
authorTeemu Ollakka <teemu.ollakka@galeracluster.com>2020-10-29 16:30:52 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2020-12-28 16:23:38 +0200
commit4601e6e565dacd074e211108acf48c067f951b4f (patch)
treef8450f482e88705508648bd02736680d7f706435 /sql/wsrep_trans_observer.h
parenta64cb6d26508c1781091ae53c8d3950952f0ed0e (diff)
downloadmariadb-git-4601e6e565dacd074e211108acf48c067f951b4f.tar.gz
MDEV-24255 MTR test galera_bf_abort fails with --ps-protocol
Under ps-protocol, commandsl like COM_STMT_FETCH, COM_STMT_CLOSE and COM_STMT_SEND_LONG_DATA are not supposed to return errors. Therefore, if a transaction is BF aborted and the client is processing one of those commands, then we should not return a deadlock error immediately. Instead wait for the a subsequent client interaction which permits errors to be returned. To handle this, wsrep_before_command() now accepts parameter keep_command_error. If set true, keep_command_error will cause wsrep-lib side to skip result handling, and to keep the current error for the next interaction with the client. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
Diffstat (limited to 'sql/wsrep_trans_observer.h')
-rw-r--r--sql/wsrep_trans_observer.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h
index 05970e8b12f..dbe710a0256 100644
--- a/sql/wsrep_trans_observer.h
+++ b/sql/wsrep_trans_observer.h
@@ -442,11 +442,17 @@ wsrep_wait_rollback_complete_and_acquire_ownership(THD *thd)
DBUG_VOID_RETURN;
}
-static inline int wsrep_before_command(THD* thd)
+static inline int wsrep_before_command(THD* thd, bool keep_command_error)
{
return (thd->wsrep_cs().state() != wsrep::client_state::s_none ?
- thd->wsrep_cs().before_command() : 0);
+ thd->wsrep_cs().before_command(keep_command_error) : 0);
+}
+
+static inline int wsrep_before_command(THD* thd)
+{
+ return wsrep_before_command(thd, false);
}
+
/*
Called after each command.