diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-27 17:38:17 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-27 17:38:17 +0300 |
commit | b63446984c2c8441c19fc646f6652a9bc3076304 (patch) | |
tree | a874d841721ba5d80f66e92e5e16dc0ab4233e2a /storage/innobase/lock | |
parent | 6dab094fbd31ef93a1d51b1b9c867188b2f958c3 (diff) | |
parent | 3568fad5c935426a275900e8130657b18ba14e9f (diff) | |
download | mariadb-git-b63446984c2c8441c19fc646f6652a9bc3076304.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'storage/innobase/lock')
-rw-r--r-- | storage/innobase/lock/lock0lock.cc | 21 | ||||
-rw-r--r-- | storage/innobase/lock/lock0wait.cc | 10 |
2 files changed, 14 insertions, 17 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 60b8fdb0070..d0b553168b2 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2019, MariaDB Corporation. +Copyright (c) 2014, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1087,9 +1087,7 @@ wsrep_kill_victim( ut_ad(trx_mutex_own(lock->trx)); /* quit for native mysql */ - if (!wsrep_on(trx->mysql_thd)) { - return; - } + if (!trx->is_wsrep()) return; if (!wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { return; @@ -1171,7 +1169,7 @@ lock_rec_other_has_conflicting( if (lock_rec_has_to_wait(true, trx, mode, lock, is_supremum)) { #ifdef WITH_WSREP - if (wsrep_on_trx(trx)) { + if (trx->is_wsrep()) { trx_mutex_enter(lock->trx); /* Below function will roll back either trx or lock->trx depending on priority of the @@ -1413,7 +1411,7 @@ lock_rec_create_low( ut_ad(index->table->get_ref_count() > 0 || !index->table->can_be_evicted); #ifdef WITH_WSREP - if (c_lock && wsrep_on_trx(trx) + if (c_lock && trx->is_wsrep() && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { lock_t *hash = (lock_t *)c_lock->hash; lock_t *prev = NULL; @@ -1819,8 +1817,7 @@ lock_rec_add_to_queue( #ifdef WITH_WSREP //ut_a(!other_lock || (wsrep_thd_is_BF(trx->mysql_thd, FALSE) && // wsrep_thd_is_BF(other_lock->trx->mysql_thd, TRUE))); - if (other_lock && - wsrep_on(trx->mysql_thd) && + if (other_lock && trx->is_wsrep() && !wsrep_thd_is_BF(trx->mysql_thd, FALSE) && !wsrep_thd_is_BF(other_lock->trx->mysql_thd, TRUE)) { @@ -3518,7 +3515,7 @@ lock_table_create( UT_LIST_ADD_LAST(trx->lock.trx_locks, lock); #ifdef WITH_WSREP - if (c_lock && wsrep_on_trx(trx)) { + if (c_lock && trx->is_wsrep()) { if (wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { ut_list_insert(table->locks, c_lock, lock, TableLockGetNode()); @@ -3748,7 +3745,7 @@ lock_table_enqueue_waiting( } #ifdef WITH_WSREP - if (trx->lock.was_chosen_as_deadlock_victim && wsrep_on_trx(trx)) { + if (trx->is_wsrep() && trx->lock.was_chosen_as_deadlock_victim) { return(DB_DEADLOCK); } #endif /* WITH_WSREP */ @@ -3821,7 +3818,7 @@ lock_table_other_has_incompatible( && (wait || !lock_get_wait(lock))) { #ifdef WITH_WSREP - if (wsrep_on(lock->trx->mysql_thd)) { + if (lock->trx->is_wsrep()) { if (wsrep_debug) { ib::info() << "WSREP: table lock abort for table:" << table->name.m_name; @@ -4888,7 +4885,7 @@ func_exit: explicit granted lock. */ #ifdef WITH_WSREP - if (wsrep_on(other_lock->trx->mysql_thd)) { + if (other_lock->trx->is_wsrep()) { if (!lock_get_wait(other_lock) ) { ib::info() << "WSREP impl BF lock conflict for my impl lock:\n BF:" << ((wsrep_thd_is_BF(impl_trx->mysql_thd, FALSE)) ? "BF" : "normal") << " exec: " << diff --git a/storage/innobase/lock/lock0wait.cc b/storage/innobase/lock/lock0wait.cc index 94104172577..b1f9b3c7d9b 100644 --- a/storage/innobase/lock/lock0wait.cc +++ b/storage/innobase/lock/lock0wait.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2019, MariaDB Corporation. +Copyright (c) 2014, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -192,8 +192,7 @@ wsrep_is_BF_lock_timeout( const trx_t* trx, bool locked = true) { - if (wsrep_on_trx(trx) - && wsrep_thd_is_BF(trx->mysql_thd, FALSE) + if (trx->is_wsrep() && wsrep_thd_is_BF(trx->mysql_thd, FALSE) && trx->error_state != DB_DEADLOCK) { ib::info() << "WSREP: BF lock wait long for trx:" << ib::hex(trx->id) << " query: " << wsrep_thd_query(trx->mysql_thd); @@ -399,8 +398,9 @@ lock_wait_suspend_thread( if (lock_wait_timeout < 100000000 && wait_time > (double) lock_wait_timeout #ifdef WITH_WSREP - && (!wsrep_on_trx(trx) || - (!wsrep_is_BF_lock_timeout(trx, false) && trx->error_state != DB_DEADLOCK)) + && (!trx->is_wsrep() + || (!wsrep_is_BF_lock_timeout(trx, false) + && trx->error_state != DB_DEADLOCK)) #endif /* WITH_WSREP */ ) { |