Commit 7bf45bec authored by Jan Lindström's avatar Jan Lindström

Fix too agressive long semaphore wait output and add guard against introducing

compression failures on insert buffer.
parent 06655a19
......@@ -159,6 +159,7 @@ INSERT INTO global_suppressions VALUES
("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"),
("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
("InnoDB: Error: table `test`.`t[123]` .*does not exist in the InnoDB internal"),
("InnoDB: Warning: semaphore wait:"),
/*
BUG#32080 - Excessive warnings on Solaris: setrlimit could not
......
......@@ -1272,6 +1272,7 @@ page_zip_compress(
records. */
if (srv_simulate_comp_failures
&& !dict_index_is_ibuf(index)
&& page_get_n_recs(page) >= 2
&& ((ulint)(rand() % 100) < srv_simulate_comp_failures)) {
......
......@@ -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) {
......
......@@ -1276,6 +1276,7 @@ page_zip_compress(
records. */
if (srv_simulate_comp_failures
&& !dict_index_is_ibuf(index)
&& page_get_n_recs(page) >= 2
&& ((ulint)(rand() % 100) < srv_simulate_comp_failures)) {
......
......@@ -995,27 +995,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) {
......@@ -1029,6 +1008,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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment