1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-20848 Fixes for MTR test galera_sr.GCF-1060 (#1421)

This patch contains two fixes:

* wsrep_handle_mdl_conflict(): handle the case where SR transaction
  is in aborting state. Previously, a BF-BF conflict was reported, and
  the process would abort.
* wsrep_thd_bf_abort(): do not restore thread vars after calling
  wsrep_bf_abort(). Thread vars are already restored in wsrep-lib if
  necessary. This also removes the assumption that the caller of
  wsrep_thd_bf_abort() is the given bf_thd, which is not the case.

Also in this patch:

* Remove unnecessary check for active victim transaction in
  wsrep_thd_bf_abort(): the exact same check is performed later in
  wsrep_bf_abort().
* Make wsrep_thd_bf_abort() and wsrep_log_thd() const-correct.
* Change signature of wsrep_abort_thd() to take THD pointers instead
  of void pointers.
This commit is contained in:
Daniele Sciascia
2019-12-04 08:21:14 +01:00
committed by Jan Lindström
parent 0b8b11b0b1
commit aab6cefe8d
8 changed files with 19 additions and 23 deletions

View File

@@ -74,7 +74,7 @@ extern struct wsrep_service_st {
const char* (*wsrep_thd_client_mode_str_func)(const MYSQL_THD thd);
const char* (*wsrep_thd_transaction_state_str_func)(const MYSQL_THD thd);
query_id_t (*wsrep_thd_transaction_id_func)(const MYSQL_THD thd);
my_bool (*wsrep_thd_bf_abort_func)(const MYSQL_THD bf_thd,
my_bool (*wsrep_thd_bf_abort_func)(MYSQL_THD bf_thd,
MYSQL_THD victim_thd,
my_bool signal);
my_bool (*wsrep_thd_order_before_func)(const MYSQL_THD left, const MYSQL_THD right);
@@ -190,7 +190,7 @@ extern "C" void wsrep_handle_SR_rollback(MYSQL_THD BF_thd, MYSQL_THD victim_thd)
/* Return thd retry counter */
extern "C" int wsrep_thd_retry_counter(const MYSQL_THD thd);
/* BF abort victim_thd */
extern "C" my_bool wsrep_thd_bf_abort(const MYSQL_THD bf_thd,
extern "C" my_bool wsrep_thd_bf_abort(MYSQL_THD bf_thd,
MYSQL_THD victim_thd,
my_bool signal);
/* Return true if left thd is ordered before right thd */