summaryrefslogtreecommitdiff
path: root/storage/innobase/include/lock0priv.h
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-12-07 12:26:29 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2017-12-07 13:08:41 +0200
commitda3a3a68df34c7fef387ce890d3925166edeef2c (patch)
tree8943d658f6a4c7751838e4e037ad438f407f8223 /storage/innobase/include/lock0priv.h
parent3eaca005ff48e84924601ecb92580a7adbaa6cfe (diff)
downloadmariadb-git-da3a3a68df34c7fef387ce890d3925166edeef2c.tar.gz
MDEV-12837: WSREP: BF lock wait long
Problem was a merge error from MySQL wsrep i.e. Galera. wsrep_on_check New check function. Galera can't be enabled if innodb-lock-schedule-algorithm=VATS. innobase_kill_query In Galera async kill we could own lock mutex. innobase_init If Variance-Aware-Transaction-Sheduling Algorithm (VATS) is used on Galera we fall back to First-Come-First-Served (FCFS) with notice to user. Changed innodb-lock-schedule-algorithm as read-only parameter as it was designed to be. lock_reset_lock_and_trx_wait Use ib::hex() to print out transaction ID. lock_rec_other_has_expl_req, lock_rec_other_has_conflicting, RecLock::add_to_waitq lock_rec_lock_slow lock_table_other_has_incompatible lock_rec_insert_check_and_lock lock_prdt_other_has_conflicting Change pointer to conflicting lock to normal pointer as this pointer contents could be changed later. RecLock::create Conclicting lock pointer is moved to last parameter with default value NULL. This conflicting transaction could be selected as victim in Galera if requesting transaction is BF (brute force) transaction. In this case contents of conflicting lock pointer will be changed. Use ib::hex() to print transaction ids.
Diffstat (limited to 'storage/innobase/include/lock0priv.h')
-rw-r--r--storage/innobase/include/lock0priv.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/storage/innobase/include/lock0priv.h b/storage/innobase/include/lock0priv.h
index 6bb75817ad6..185779e476f 100644
--- a/storage/innobase/include/lock0priv.h
+++ b/storage/innobase/include/lock0priv.h
@@ -721,7 +721,7 @@ public:
as a victim, and we got the lock immediately: no need to
wait then */
dberr_t add_to_waitq(
- const lock_t* wait_for,
+ lock_t* wait_for,
const lock_prdt_t*
prdt = NULL);
@@ -731,21 +731,22 @@ public:
@param[in] owns_trx_mutex true if caller owns the trx_t::mutex
@param[in] add_to_hash add the lock to hash table
@param[in] prdt Predicate lock (optional)
+ @param[in,out] c_lock Conflicting lock request or NULL
+ in Galera conflicting lock is selected
+ as deadlock victim if requester
+ is BF transaction.
@return new lock instance */
lock_t* create(
trx_t* trx,
bool owns_trx_mutex,
bool add_to_hash,
const lock_prdt_t*
- prdt = NULL);
+ prdt = NULL
+#ifdef WITH_WSREP
+ ,lock_t* c_lock = NULL
+#endif /* WITH_WSREP */
+ );
- lock_t* create(
- lock_t* const c_lock,
- trx_t* trx,
- bool owns_trx_mutex,
- bool add_to_hash,
- const lock_prdt_t*
- prdt = NULL);
/**
Check of the lock is on m_rec_id.
@param[in] lock Lock to compare with