Commit 25318038 authored by Jan Lindström's avatar Jan Lindström

Fixed hang seen on TPC-C measure phase. We should not use timedwait on threads

waiting for a job. They should sleep and let other threads to their work. At
shutdown, we know that we put "work" and that is handled as soon as possible.
parent cae21c52
...@@ -276,12 +276,12 @@ mtflush_service_io( ...@@ -276,12 +276,12 @@ mtflush_service_io(
ulint n_flushed=0; ulint n_flushed=0;
mtflush_io->wt_status = WTHR_SIG_WAITING; mtflush_io->wt_status = WTHR_SIG_WAITING;
work_item = (wrk_t *)ib_wqueue_timedwait(mtflush_io->wq, MT_WAIT_IN_USECS); work_item = (wrk_t *)ib_wqueue_wait(mtflush_io->wq);
if (work_item) { if (work_item) {
mtflush_io->wt_status = WTHR_RUNNING; mtflush_io->wt_status = WTHR_RUNNING;
} else { } else {
/* Because of timeout this thread did not get any work */ /* Thread did not get any work */
mtflush_io->wt_status = WTHR_NO_WORK; mtflush_io->wt_status = WTHR_NO_WORK;
return; return;
} }
...@@ -551,7 +551,7 @@ buf_mtflu_flush_work_items( ...@@ -551,7 +551,7 @@ buf_mtflu_flush_work_items(
/* wait on the completion to arrive */ /* wait on the completion to arrive */
for(i=0; i< buf_pool_inst;) { for(i=0; i< buf_pool_inst;) {
done_wi = (wrk_t *)ib_wqueue_timedwait(mtflush_ctx->wr_cq, MT_WAIT_IN_USECS); done_wi = (wrk_t *)ib_wqueue_wait(mtflush_ctx->wr_cq);
if (done_wi != NULL) { if (done_wi != NULL) {
if(done_wi->n_flushed == 0) { if(done_wi->n_flushed == 0) {
......
...@@ -282,12 +282,12 @@ mtflush_service_io( ...@@ -282,12 +282,12 @@ mtflush_service_io(
ulint n_flushed=0; ulint n_flushed=0;
mtflush_io->wt_status = WTHR_SIG_WAITING; mtflush_io->wt_status = WTHR_SIG_WAITING;
work_item = (wrk_t *)ib_wqueue_timedwait(mtflush_io->wq, MT_WAIT_IN_USECS); work_item = (wrk_t *)ib_wqueue_wait(mtflush_io->wq);
if (work_item) { if (work_item) {
mtflush_io->wt_status = WTHR_RUNNING; mtflush_io->wt_status = WTHR_RUNNING;
} else { } else {
/* Because of timeout this thread did not get any work */ /* Thread did not get any work */
mtflush_io->wt_status = WTHR_NO_WORK; mtflush_io->wt_status = WTHR_NO_WORK;
return; return;
} }
...@@ -557,7 +557,7 @@ buf_mtflu_flush_work_items( ...@@ -557,7 +557,7 @@ buf_mtflu_flush_work_items(
/* wait on the completion to arrive */ /* wait on the completion to arrive */
for(i=0; i< buf_pool_inst;) { for(i=0; i< buf_pool_inst;) {
done_wi = (wrk_t *)ib_wqueue_timedwait(mtflush_ctx->wr_cq, MT_WAIT_IN_USECS); done_wi = (wrk_t *)ib_wqueue_wait(mtflush_ctx->wr_cq);
if (done_wi != NULL) { if (done_wi != NULL) {
if(done_wi->n_flushed == 0) { if(done_wi->n_flushed == 0) {
......
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