Skip to content

Commit

Permalink
Fixed hang seen on TPC-C measure phase. We should not use timedwait o…
Browse files Browse the repository at this point in the history
…n 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.
  • Loading branch information
Jan Lindström committed Feb 15, 2014
1 parent cae21c5 commit 2531803
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions storage/innobase/buf/buf0mtflu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@ mtflush_service_io(
ulint n_flushed=0;

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) {
mtflush_io->wt_status = WTHR_RUNNING;
} else {
/* Because of timeout this thread did not get any work */
/* Thread did not get any work */
mtflush_io->wt_status = WTHR_NO_WORK;
return;
}
Expand Down Expand Up @@ -551,7 +551,7 @@ buf_mtflu_flush_work_items(

/* wait on the completion to arrive */
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->n_flushed == 0) {
Expand Down
6 changes: 3 additions & 3 deletions storage/xtradb/buf/buf0mtflu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ mtflush_service_io(
ulint n_flushed=0;

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) {
mtflush_io->wt_status = WTHR_RUNNING;
} else {
/* Because of timeout this thread did not get any work */
/* Thread did not get any work */
mtflush_io->wt_status = WTHR_NO_WORK;
return;
}
Expand Down Expand Up @@ -557,7 +557,7 @@ buf_mtflu_flush_work_items(

/* wait on the completion to arrive */
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->n_flushed == 0) {
Expand Down

0 comments on commit 2531803

Please sign in to comment.