Comment 1 for bug 1250018

Ovais Tariq (ovais-tariq) wrote :

I also find the below semaphore waits possibly related to LRU eviction of index.

InnoDB: Warning: a long semaphore wait:
--Thread 22 has waited at row0purge.c line 682 for 241.00 seconds the semaphore:
Mutex at 27294d8a8 '&dict_sys->mutex', lock var 1
waiters flag 1
InnoDB: ###### Starts InnoDB Monitor for 30 secs to print diagnostic info:
InnoDB: Pending preads 0, pwrites 0

=====================================
131111 0:41:17 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 15 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 36034 1_second, 36033 sleeps, 3601 10_second, 442 background, 442 flush
srv_master_thread log flush and writes: 37289
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 392362, signal count 406553
--Thread 22 has waited at row0purge.c line 682 for 246.00 seconds the semaphore:
Mutex at 27294d8a8 '&dict_sys->mutex', lock var 1
waiters flag 1
--Thread 27 has waited at btr0sea.c line 1778 for 0.0000 seconds the semaphore:
X-lock (wait_ex) on RW-latch at e52d77d8 'btr_search_latch_part[i]'
a writer (thread id 27) has reserved it in mode wait exclusive
number of readers 1, waiters flag 0, lock_word: ffffffffffffffff
Last time read locked in file btr0sea.c line 1420
Last time write locked in file /var/tmp/tmp.a5aenR/Percona-Server-5.5.33-rel31.1/storage/innobase/btr/btr0sea.c line 1374
Mutex spin waits 6117445, rounds 21430759, OS waits 326581
RW-shared spins 54246, rounds 639853, OS waits 16738
RW-excl spins 253164, rounds 1848521, OS waits 44718
Spin rounds per wait: 3.50 mutex, 11.80 RW-shared, 7.30 RW-excl

Purge operation is waiting on the dict_sys->mutex to be able to do purge of an undo log record, while it appears that the dict_sys->mutex is being held as part of the data dictionary LRU eviction process:

- storage/innobase/dict/dict0dict.c
1940 void
1941 dict_index_remove_from_cache(
...
1953 ut_ad(mutex_own(&(dict_sys->mutex)));