summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsjaakola <seppo.jaakola@iki.fi>2022-10-12 15:07:20 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2023-01-13 13:11:03 +0200
commit0ff7f33c7b5d0b5373472f4706aff4d19dc84258 (patch)
tree928ad3656a9f0026621695ec22f33278ced3042f
parent68cfcf9cb6821c3d333b97b213b44627e433861c (diff)
downloadmariadb-git-0ff7f33c7b5d0b5373472f4706aff4d19dc84258.tar.gz
10.4-MDEV-29684 Fixes for cluster wide write conflict resolving
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 <jan.lindstrom@mariadb.com>
-rw-r--r--sql/sql_class.cc5
1 files 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 *>(thd), false) &&
- wsrep_thd_is_BF(const_cast<THD *>(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;