Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Fix
-
10.2.30, 10.3.21, 10.4.11
-
None
Description
When a semaphore wait is in progress, InnoDB prints information about the wait in sync_array_cell_print():
https://github.com/MariaDB/server/blob/mariadb-10.2.30/storage/innobase/sync/sync0arr.cc#L478
For mutexes, the function does print the mutex's name. For example, here is a log message for trx_sys->mutex which is identified by TRX_SYS:
2019-10-31 0:25:00 140385734620928 [Warning] InnoDB: A long semaphore wait:
|
--Thread 140377401067264 has waited at read0read.cc line 579 for 241.00 seconds the semaphore:
|
Mutex at 0x138221ac0, Mutex TRX_SYS created trx0sys.cc:552, lock var 2
|
However, for RW-latches, the function does not print the RW-latch's name. For example:
2019-10-31 0:25:00 140385734620928 [Warning] InnoDB: A long semaphore wait:
|
--Thread 140379826886400 has waited at btr0cur.cc line 1151 for 241.00 seconds the semaphore:
|
S-lock on RW-latch at 0x138245380 created in file ibuf0ibuf.cc line 563
|
a writer (thread id 140379818493696) has reserved it in mode exclusive
|
number of readers 0, waiters flag 1, lock_word: fffffffff0000000
|
Last time read locked in file btr0cur.cc line 1151
|
Last time write locked in file ibuf0ibuf.cc line 399
|
You can still determine the RW-latch's name by looking for strings like created in file ibuf0ibuf.cc line 563. This specific output was taken from MariaDB 10.2.21, so we would need to look at that specific file for that specific version. Let's take a look:
https://github.com/MariaDB/server/blob/mariadb-10.2.21/storage/innobase/ibuf/ibuf0ibuf.cc#L562
We can see that this specific RW-latch is ibuf->index->lock.
I suspect that users could also determine what the specific RW-latch is by looking for strings like at 0x138245380 and using debugging tools like gdb to inspect the memory address.
However, these kinds of tedious analytical methods should not be required. The lock monitor should print an easily identifiable name for the RW-latch, just like it already does for mutexes, so that users do not need to do tedious things to determine what the specific RW-latch is called.
Attachments
Issue Links
- relates to
-
MDEV-22087 Increase buffer size for query in SHOW ENGINE INNODB STATUS output
- Open
-
MDEV-17237 thread IDs are printed in different formats in different sections of SHOW ENGINE INNODB STATUS output
- Open
-
MDEV-17238 Document special thread IDs used in SHOW ENGINE INNODB STATUS output
- Open
-
MDEV-18391 Print ENGINE INNODB STATUS in machine parsable format
- Open
-
MDEV-18429 Consistent non-locking reads do not appear in TRANSACTIONS section of SHOW ENGINE INNODB STATUS
- Closed
-
MDEV-18572 Thread executing DROP TABLE listed twice in SHOW ENGINE INNODB STATUS output
- Open
-
MDEV-18582 Port status variables related to SHOW ENGINE INNODB STATUS from XtraDB to InnoDB in 10.2+
- Closed
-
MDEV-18698 Show InnoDB's internal background threads in SHOW ENGINE INNODB STATUS
- Open
-
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-21390 lock_print_info_summary() should work even when trx_sys.mutex is locked
- Closed