summaryrefslogtreecommitdiff
path: root/sql/wsrep_thd.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-06-19 19:25:15 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2015-06-19 19:25:15 -0400
commitfc716dc5a5abd6997310256a1f846e39ea5bf312 (patch)
tree79fa59355e1ba3a5e315d0ead5a73c1880cc3388 /sql/wsrep_thd.cc
parent6050ab658696925f2a031b901eb398fff65fa92a (diff)
downloadmariadb-git-fc716dc5a5abd6997310256a1f846e39ea5bf312.tar.gz
MDEV-8260 : Issues related to concurrent CTAS
* Wait for aborted thd (victim) to release MDL locks * Skip aborting an already aborted thd * Defer setting OK status in case of CTAS * Minor cosmetic changes * Added a test case
Diffstat (limited to 'sql/wsrep_thd.cc')
-rw-r--r--sql/wsrep_thd.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index 53684935f99..50e8a09706b 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -495,6 +495,17 @@ int wsrep_abort_thd(void *bf_thd_ptr, void *victim_thd_ptr, my_bool signal)
bf_thd->wsrep_exec_mode == TOTAL_ORDER) ) &&
victim_thd)
{
+ if ((victim_thd->wsrep_conflict_state == MUST_ABORT) ||
+ (victim_thd->wsrep_conflict_state == ABORTED) ||
+ (victim_thd->wsrep_conflict_state == ABORTING))
+ {
+ WSREP_DEBUG("wsrep_abort_thd called by %llu with victim %llu already "
+ "aborted. Ignoring.",
+ (bf_thd) ? (long long)bf_thd->real_id : 0,
+ (long long)victim_thd->real_id);
+ DBUG_RETURN(1);
+ }
+
WSREP_DEBUG("wsrep_abort_thd, by: %llu, victim: %llu", (bf_thd) ?
(long long)bf_thd->real_id : 0, (long long)victim_thd->real_id);
ha_wsrep_abort_transaction(bf_thd, victim_thd, signal);