From 0ff7f33c7b5d0b5373472f4706aff4d19dc84258 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Wed, 12 Oct 2022 15:07:20 +0300 Subject: [PATCH] 10.4-MDEV-29684 Fixes for cluster wide write conflict resolving MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rather recent thd_need_ordering_with() function does not take high priority transactions' order in consideration. Chaged this funtion to compare also transaction seqnos and favor earlier transaction. Reviewed-by: Jan Lindström --- sql/sql_class.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 10bee9e7aae..b516791b6da 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -5230,8 +5230,9 @@ thd_need_ordering_with(const MYSQL_THD thd, const MYSQL_THD other_thd) (e.g. InnoDB does it by keeping lock_sys.mutex locked) */ if (WSREP_ON && - wsrep_thd_is_BF(const_cast(thd), false) && - wsrep_thd_is_BF(const_cast(other_thd), false)) + wsrep_thd_is_BF(thd, false) && + wsrep_thd_is_BF(other_thd, false) && + wsrep_thd_order_before(thd, other_thd)) return 0; #endif /* WITH_WSREP */ rgi= thd->rgi_slave;