mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
srv0srv.c:
Put back a 50 millisecond sleep in too high concurrency situations which I removed in the previous push; count also such sleeping threads to the InnoDB queue in SHOW INNODB STATUS innobase/srv/srv0srv.c: Put back a 50 millisecond sleep in too high concurrency situations which I removed in the previous push; count also such sleeping threads to the InnoDB queue in SHOW INNODB STATUS
This commit is contained in:
parent
706dc59f58
commit
d1b9076e51
1 changed files with 24 additions and 1 deletions
|
|
@ -1739,6 +1739,7 @@ srv_conc_enter_innodb(
|
||||||
trx_t* trx) /* in: transaction object associated with the
|
trx_t* trx) /* in: transaction object associated with the
|
||||||
thread */
|
thread */
|
||||||
{
|
{
|
||||||
|
ibool has_slept = FALSE;
|
||||||
srv_conc_slot_t* slot;
|
srv_conc_slot_t* slot;
|
||||||
ulint i;
|
ulint i;
|
||||||
char err_buf[1000];
|
char err_buf[1000];
|
||||||
|
|
@ -1759,7 +1760,7 @@ srv_conc_enter_innodb(
|
||||||
}
|
}
|
||||||
|
|
||||||
os_fast_mutex_lock(&srv_conc_mutex);
|
os_fast_mutex_lock(&srv_conc_mutex);
|
||||||
|
retry:
|
||||||
if (trx->declared_to_be_inside_innodb) {
|
if (trx->declared_to_be_inside_innodb) {
|
||||||
ut_print_timestamp(stderr);
|
ut_print_timestamp(stderr);
|
||||||
|
|
||||||
|
|
@ -1784,6 +1785,28 @@ srv_conc_enter_innodb(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the transaction is not holding resources, let it sleep for 50
|
||||||
|
milliseconds, and try again then */
|
||||||
|
|
||||||
|
if (!has_slept && !trx->has_search_latch
|
||||||
|
&& NULL == UT_LIST_GET_FIRST(trx->trx_locks)) {
|
||||||
|
|
||||||
|
has_slept = TRUE; /* We let is sleep only once to avoid
|
||||||
|
starvation */
|
||||||
|
|
||||||
|
srv_conc_n_waiting_threads++;
|
||||||
|
|
||||||
|
os_fast_mutex_unlock(&srv_conc_mutex);
|
||||||
|
|
||||||
|
os_thread_sleep(50000);
|
||||||
|
|
||||||
|
os_fast_mutex_lock(&srv_conc_mutex);
|
||||||
|
|
||||||
|
srv_conc_n_waiting_threads--;
|
||||||
|
|
||||||
|
goto retry;
|
||||||
|
}
|
||||||
|
|
||||||
/* Too many threads inside: put the current thread to a queue */
|
/* Too many threads inside: put the current thread to a queue */
|
||||||
|
|
||||||
for (i = 0; i < OS_THREAD_MAX_N; i++) {
|
for (i = 0; i < OS_THREAD_MAX_N; i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue