Skip to content

Commit 2531803

Browse files
author
Jan Lindström
committed
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.
1 parent cae21c5 commit 2531803

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

storage/innobase/buf/buf0mtflu.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,12 @@ mtflush_service_io(
276276
ulint n_flushed=0;
277277

278278
mtflush_io->wt_status = WTHR_SIG_WAITING;
279-
work_item = (wrk_t *)ib_wqueue_timedwait(mtflush_io->wq, MT_WAIT_IN_USECS);
279+
work_item = (wrk_t *)ib_wqueue_wait(mtflush_io->wq);
280280

281281
if (work_item) {
282282
mtflush_io->wt_status = WTHR_RUNNING;
283283
} else {
284-
/* Because of timeout this thread did not get any work */
284+
/* Thread did not get any work */
285285
mtflush_io->wt_status = WTHR_NO_WORK;
286286
return;
287287
}
@@ -551,7 +551,7 @@ buf_mtflu_flush_work_items(
551551

552552
/* wait on the completion to arrive */
553553
for(i=0; i< buf_pool_inst;) {
554-
done_wi = (wrk_t *)ib_wqueue_timedwait(mtflush_ctx->wr_cq, MT_WAIT_IN_USECS);
554+
done_wi = (wrk_t *)ib_wqueue_wait(mtflush_ctx->wr_cq);
555555

556556
if (done_wi != NULL) {
557557
if(done_wi->n_flushed == 0) {

storage/xtradb/buf/buf0mtflu.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,12 @@ mtflush_service_io(
282282
ulint n_flushed=0;
283283

284284
mtflush_io->wt_status = WTHR_SIG_WAITING;
285-
work_item = (wrk_t *)ib_wqueue_timedwait(mtflush_io->wq, MT_WAIT_IN_USECS);
285+
work_item = (wrk_t *)ib_wqueue_wait(mtflush_io->wq);
286286

287287
if (work_item) {
288288
mtflush_io->wt_status = WTHR_RUNNING;
289289
} else {
290-
/* Because of timeout this thread did not get any work */
290+
/* Thread did not get any work */
291291
mtflush_io->wt_status = WTHR_NO_WORK;
292292
return;
293293
}
@@ -557,7 +557,7 @@ buf_mtflu_flush_work_items(
557557

558558
/* wait on the completion to arrive */
559559
for(i=0; i< buf_pool_inst;) {
560-
done_wi = (wrk_t *)ib_wqueue_timedwait(mtflush_ctx->wr_cq, MT_WAIT_IN_USECS);
560+
done_wi = (wrk_t *)ib_wqueue_wait(mtflush_ctx->wr_cq);
561561

562562
if (done_wi != NULL) {
563563
if(done_wi->n_flushed == 0) {

0 commit comments

Comments
 (0)