Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6
Description
The InnoDB custom implementation of a read-write latch (rw_lock_t) encapsulates two os_event_t. Both os_event_t encapsulate a mutex and a condition variable. One mutex would suffice. There also are some data fields to control the waiting, although the rw_lock_t::lock_word alone is sufficient for that.
As part of MDEV-21452, we would replace all os_event_t with condition variables. Simplifying the read-write latch implementation is a prerequisite for that.
Attachments
Issue Links
- blocks
-
MDEV-14659 Innodb scalibility issue found in Mariadb code for complex 'select' queries in Arm platform
-
- Closed
-
-
MDEV-18976 Implement a CHECKSUM redo log record for improved validation
-
- Closed
-
-
MDEV-21452 Use condition variables and normal mutexes instead of InnoDB os_event and mutex
-
- Closed
-
- causes
-
MDEV-24642 Assertion `r->emplace(pthread_self()).second' failed in sux_lock<srw>::s_lock_register()
-
- Closed
-
-
MDEV-24643 Assertion `(l & (WRITER | UPDATER)) == UPDATER' failed in void rw_lock::update_unlock()
-
- Closed
-
-
MDEV-24834 Assertion `mtr->memo_contains_flagged( &index->lock, MTR_MEMO_S_LOCK)' failed in btr_cur_search_to_nth_level_func
-
- Closed
-
-
MDEV-25512 Deadlock between sux_lock::u_x_upgrade() and sux_lock::u_lock()
-
- Closed
-
-
MDEV-29336 mysqld: storage/innobase/include/sux_lock.h:404: void sux_lock<ssux>::u_x_upgrade() [with ssux = ssux_lock_impl<true>]: Assertion `have_u_not_x()' failed.
-
- Closed
-
-
MDEV-33855 MSAN use-of-uninitialized-value in rtr_pcur_getnext_from_path()
-
- Closed
-
- is blocked by
-
MDEV-24167 InnoDB unnecessarily uses complex rw-lock implementation
-
- Closed
-
-
MDEV-24240 Pessimistic operations on SPATIAL INDEX wrongly release page latches
-
- Open
-
- relates to
-
MDEV-7109 Add support for INFORMATION_SCHEMA.INNODB_SEMAPHORE_WAITS
-
- Closed
-
-
MDEV-7399 Add support for INFORMATION_SCHEMA.INNODB_MUTEXES
-
- Closed
-
-
MDEV-24410 Deadlock between freeing and allocating undo pages
-
- Closed
-
-
MDEV-24786 Assertion `!have_x()' failed in sux_lock<srw>::s_lock() [with srw = ssux_lock_low]
-
- Closed
-
-
MDEV-25267 Reported latching order violation in ibuf_remove_free_page()
-
- Closed
-
-
MDEV-26467 Unnecessary compare-and-swap loop in futex-based synchronization
-
- Closed
-
-
MDEV-27058 Buffer page descriptors are too large
-
- Closed
-
-
MDEV-34759 buf_page_get_low() is unnecessarily acquiring exclusive latch on secondary index pages
-
- Closed
-
-
MDEV-15798 Mutex leak on accessing INFORMATION_SCHEMA.INNODB_MUTEXES
-
- Closed
-
-
MDEV-21330 Lock monitor doesn't print a semaphore's last reserved thread in non-debug builds and INFORMATION_SCHEMA.INNODB_SYS_SEMAPHORE_WAITS is totally broken
-
- Closed
-
-
MDEV-24630 MY_RELAX_CPU assembly instruction upgrade/research for memory barrier on ARM
-
- Closed
-
-
MDEV-25404 read-only performance regression in 10.6
-
- Closed
-
-
MDEV-32065 Always check whether lock is free at first to optimize InnoDB mutexes
-
- Open
-
With the approach based on two srw_lock there is a potential deadlock if s_lock() is acquired after u_lock(). To solve this, I unconditionally implemented srw_lock always based on rw_lock and its std::atomic<uint32_t>, and in the end implemented an update lock in rw_lock and srw_lock. The only additional ‘service’ of sux_lock is that it allows recursive U and X locks, as required by InnoDB dict_index_t::lock and dict_block_t::lock. Compared to old rw_lock_t, if an U lock is upgraded to X lock, then all pre-existing U lock in the mtr_t::m_memo must be edited to X lock. This was necessary, because a u_unlock() after an x_unlock() is not allowed.