summaryrefslogtreecommitdiff
path: root/sql/service_wsrep.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/service_wsrep.cc')
-rw-r--r--sql/service_wsrep.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/sql/service_wsrep.cc b/sql/service_wsrep.cc
index f0f9530c80d..943db803242 100644
--- a/sql/service_wsrep.cc
+++ b/sql/service_wsrep.cc
@@ -1,4 +1,4 @@
-/* Copyright 2018 Codership Oy <info@codership.com>
+/* Copyright 2018-2023 Codership Oy <info@codership.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -253,7 +253,9 @@ extern "C" my_bool wsrep_thd_skip_locking(const THD *thd)
extern "C" my_bool wsrep_thd_order_before(const THD *left, const THD *right)
{
- if (wsrep_thd_trx_seqno(left) < wsrep_thd_trx_seqno(right)) {
+ if (wsrep_thd_is_BF(left, false) &&
+ wsrep_thd_is_BF(right, false) &&
+ wsrep_thd_trx_seqno(left) < wsrep_thd_trx_seqno(right)) {
WSREP_DEBUG("BF conflict, order: %lld %lld\n",
(long long)wsrep_thd_trx_seqno(left),
(long long)wsrep_thd_trx_seqno(right));
@@ -368,13 +370,20 @@ extern "C" ulong wsrep_OSU_method_get(const MYSQL_THD thd)
extern "C" bool wsrep_thd_set_wsrep_aborter(THD *bf_thd, THD *victim_thd)
{
- WSREP_DEBUG("wsrep_thd_set_wsrep_aborter called");
mysql_mutex_assert_owner(&victim_thd->LOCK_thd_data);
+ if (!bf_thd)
+ {
+ victim_thd->wsrep_aborter= 0;
+ WSREP_DEBUG("wsrep_thd_set_wsrep_aborter resetting wsrep_aborter");
+ return false;
+ }
if (victim_thd->wsrep_aborter && victim_thd->wsrep_aborter != bf_thd->thread_id)
{
return true;
}
- victim_thd->wsrep_aborter = bf_thd->thread_id;
+ victim_thd->wsrep_aborter= bf_thd->thread_id;
+ WSREP_DEBUG("wsrep_thd_set_wsrep_aborter setting wsrep_aborter %u",
+ victim_thd->wsrep_aborter);
return false;
}