summaryrefslogtreecommitdiff
path: root/storage/xtradb/lock
diff options
context:
space:
mode:
authorsensssz <hjmsens@gmail.com>2016-12-01 13:45:23 -0500
committerJan Lindström <jan.lindstrom@mariadb.com>2016-12-02 11:08:18 +0200
commit2fd3af44830e8df9d60f2e8a955f9ed17e744986 (patch)
tree1eb0645f5d8a39be8211e17b057a57c36df35760 /storage/xtradb/lock
parentdbdef41a59ced64e21cd6c9059ce85496662212b (diff)
downloadmariadb-git-2fd3af44830e8df9d60f2e8a955f9ed17e744986.tar.gz
MDEV-11168: InnoDB: Failing assertion: !other_lock || wsrep_thd_is_BF(lock->trx->mysql_thd, FALSE) || wsrep_thd_is_BF(other_lock->trx->mysql_thd, FALSE)
Merged pull request: Fix error in lock_has_higher_priority #266 https://github.com/MariaDB/server/pull/266 Added test case.
Diffstat (limited to 'storage/xtradb/lock')
-rw-r--r--storage/xtradb/lock/lock0lock.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc
index 13edfb2e7ea..af2c823af64 100644
--- a/storage/xtradb/lock/lock0lock.cc
+++ b/storage/xtradb/lock/lock0lock.cc
@@ -2057,8 +2057,6 @@ wsrep_print_wait_locks(
/*********************************************************************//**
Check if lock1 has higher priority than lock2.
NULL has lowest priority.
-Respect the preference of the upper server layer to reduce conflict
-during in-order parallel replication.
If neither of them is wait lock, the first one has higher priority.
If only one of them is a wait lock, it has lower priority.
Otherwise, the one with an older transaction has higher priority.
@@ -2073,15 +2071,6 @@ has_higher_priority(
} else if (lock2 == NULL) {
return true;
}
- // Ask the upper server layer if any of the two trx should be prefered.
- int preference = thd_deadlock_victim_preference(lock1->trx->mysql_thd, lock2->trx->mysql_thd);
- if (preference == -1) {
- // lock1 is preferred as a victim, so lock2 has higher priority
- return false;
- } else if (preference == 1) {
- // lock2 is preferred as a victim, so lock1 has higher priority
- return true;
- }
// No preference. Compre them by wait mode and trx age.
if (!lock_get_wait(lock1)) {
return true;
@@ -6713,7 +6702,6 @@ lock_rec_queue_validate(
if (!lock_rec_get_gap(lock) && !lock_get_wait(lock)) {
-#ifndef WITH_WSREP
enum lock_mode mode;
@@ -6722,8 +6710,18 @@ lock_rec_queue_validate(
} else {
mode = LOCK_S;
}
- ut_a(!lock_rec_other_has_expl_req(
- mode, 0, 0, block, heap_no, lock->trx->id));
+
+ const lock_t* other_lock
+ = lock_rec_other_has_expl_req(
+ mode, 0, 0, block, heap_no,
+ lock->trx->id);
+#ifdef WITH_WSREP
+ ut_a(!other_lock
+ || wsrep_thd_is_BF(lock->trx->mysql_thd, FALSE)
+ || wsrep_thd_is_BF(other_lock->trx->mysql_thd, FALSE));
+
+#else
+ ut_a(!other_lock);
#endif /* WITH_WSREP */
} else if (lock_get_wait(lock) && !lock_rec_get_gap(lock)