summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-01-20 14:00:27 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-01-20 14:00:27 +0200
commitc3d6565413bdf4c6f9fad2c4cab1f7c6bcffbd24 (patch)
tree945836adb76247ab83353c43c58c739e2382ac6d
parentbec347b8be9e6327583599f5e519f63ea8fc68d1 (diff)
downloadmariadb-git-bb-10.6-MDEV-20612-2.tar.gz
Cleanup: Remove some static constbb-10.6-MDEV-20612-2
-rw-r--r--storage/innobase/include/lock0priv.h18
-rw-r--r--storage/innobase/lock/lock0lock.cc13
2 files changed, 4 insertions, 27 deletions
diff --git a/storage/innobase/include/lock0priv.h b/storage/innobase/include/lock0priv.h
index 4db6423b2b5..7d5a606247e 100644
--- a/storage/innobase/include/lock0priv.h
+++ b/storage/innobase/include/lock0priv.h
@@ -115,24 +115,6 @@ operator<<(std::ostream& out, const ib_lock_t& lock)
extern ibool lock_print_waits;
#endif /* UNIV_DEBUG */
-/** Restricts the length of search we will do in the waits-for
-graph of transactions */
-static const ulint LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK = 1000000;
-
-/** Restricts the search depth we will do in the waits-for graph of
-transactions */
-static const ulint LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK = 200;
-
-/** When releasing transaction locks, this specifies how often we release
-the lock mutex for a moment to give also others access to it */
-static const ulint LOCK_RELEASE_INTERVAL = 1000;
-
-/* Safety margin when creating a new record lock: this many extra records
-can be inserted to the page without need to create a lock with a bigger
-bitmap */
-
-static const ulint LOCK_PAGE_BITMAP_MARGIN = 64;
-
/* An explicit record lock affects both the record and the gap before it.
An implicit x-lock does not affect the gap, it only locks the index
record from read or update.
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 385f2b05262..31954b829d8 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -107,10 +107,8 @@ private:
}
/** Check if the search is too deep. */
- bool is_too_deep() const
- {
- return(m_n_elems > LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK
- || m_cost > LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK);
+ bool is_too_deep() const {
+ return m_n_elems > 200 || m_cost > 1000000;
}
/** Save current state.
@@ -1218,7 +1216,6 @@ lock_rec_create_low(
bool holds_trx_mutex)
{
lock_t* lock;
- ulint n_bits;
ulint n_bytes;
lock_sys.assert_locked(page_id);
@@ -1244,9 +1241,7 @@ lock_rec_create_low(
}
if (UNIV_LIKELY(!(type_mode & (LOCK_PREDICATE | LOCK_PRDT_PAGE)))) {
- /* Make lock bitmap bigger by a safety margin */
- n_bits = page_dir_get_n_heap(page) + LOCK_PAGE_BITMAP_MARGIN;
- n_bytes = 1 + n_bits / 8;
+ n_bytes = (page_dir_get_n_heap(page) + 7) / 8;
} else {
ut_ad(heap_no == PRDT_HEAPNO);
@@ -3799,7 +3794,7 @@ void lock_release(trx_t* trx)
lock_table_dequeue(lock);
}
- if (count == LOCK_RELEASE_INTERVAL) {
+ if (count == 1000) {
/* Release the mutex for a while, so that we
do not monopolize it */