diff options
author | Jan Lindström <jplindst@mariadb.org> | 2014-07-24 14:35:09 +0300 |
---|---|---|
committer | Jan Lindström <jplindst@mariadb.org> | 2014-07-24 14:35:09 +0300 |
commit | 7bf45bec5436cf1c61fa08f007eb4bb26aac1cf7 (patch) | |
tree | 300b986b3a96d5cc796d6d3d6d84da655ee67b06 /storage/innobase/sync | |
parent | 06655a192d7d3216fccc18c1f25601c4ecff09d4 (diff) | |
download | mariadb-git-7bf45bec5436cf1c61fa08f007eb4bb26aac1cf7.tar.gz |
Fix too agressive long semaphore wait output and add guard against introducing
compression failures on insert buffer.
Diffstat (limited to 'storage/innobase/sync')
-rw-r--r-- | storage/innobase/sync/sync0arr.c | 61 |
1 files changed, 40 insertions, 21 deletions
diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c index 51461c00db0..ea4d496e6b5 100644 --- a/storage/innobase/sync/sync0arr.c +++ b/storage/innobase/sync/sync0arr.c @@ -971,27 +971,6 @@ sync_array_print_long_waits( stderr); sync_array_cell_print(stderr, cell, &reserver); noticed = TRUE; - } else { - fputs("InnoDB: Warning: semaphore wait:\n", - stderr); - sync_array_cell_print(stderr, cell, &reserver); - } - - /* Try to output cell information for writer recursive way */ - while (reserver != 0) { - sync_cell_t* reserver_wait; - - reserver_wait = sync_array_find_thread(sync_primary_wait_array, reserver); - - if (reserver_wait && - reserver_wait->wait_object != NULL && - reserver_wait->waiting) { - fputs("InnoDB: Warning: Writer thread is waiting this semaphore:\n", - stderr); - sync_array_cell_print(stderr, reserver_wait, &reserver); - } else { - reserver = 0; - } } if (diff > fatal_timeout) { @@ -1005,6 +984,46 @@ sync_array_print_long_waits( } } + /* We found a long semaphore wait, wait all threads that are + waiting for a semaphore. */ + if (noticed) { + for (i = 0; i < sync_primary_wait_array->n_cells; i++) { + void* wait_object; + os_thread_id_t reserver=0; + + cell = sync_array_get_nth_cell(sync_primary_wait_array, i); + + wait_object = cell->wait_object; + + if (wait_object == NULL || !cell->waiting) { + + continue; + } + + fputs("InnoDB: Warning: semaphore wait:\n", + stderr); + sync_array_cell_print(stderr, cell, &reserver); + noticed = TRUE; + + /* Try to output cell information for writer recursive way */ + while (reserver != 0) { + sync_cell_t* reserver_wait; + + reserver_wait = sync_array_find_thread(sync_primary_wait_array, reserver); + + if (reserver_wait && + reserver_wait->wait_object != NULL && + reserver_wait->waiting) { + fputs("InnoDB: Warning: Writer thread is waiting this semaphore:\n", + stderr); + sync_array_cell_print(stderr, reserver_wait, &reserver); + } else { + reserver = 0; + } + } + } + } + sync_array_exit(sync_primary_wait_array); if (noticed) { |