diff options
Diffstat (limited to 'sql/wsrep_client_service.cc')
-rw-r--r-- | sql/wsrep_client_service.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/wsrep_client_service.cc b/sql/wsrep_client_service.cc index 62b90cc032f..dd6d7d0bcfb 100644 --- a/sql/wsrep_client_service.cc +++ b/sql/wsrep_client_service.cc @@ -260,6 +260,7 @@ enum wsrep::provider::status Wsrep_client_service::replay() replayer_service.replay_status(ret); mysql_mutex_lock(&LOCK_wsrep_replaying); --wsrep_replaying; + mysql_cond_broadcast(&COND_wsrep_replaying); mysql_mutex_unlock(&LOCK_wsrep_replaying); return ret; } @@ -269,9 +270,15 @@ void Wsrep_client_service::wait_for_replayers(wsrep::unique_lock<wsrep::mutex>& DBUG_ASSERT(m_thd == current_thd); lock.unlock(); mysql_mutex_lock(&LOCK_wsrep_replaying); - while (wsrep_replaying > 0) + /* We need to check if the THD is BF aborted during condition wait. + Because the aborter does not know which condition this thread is waiting, + use timed wait and check if the THD is BF aborted in the loop. */ + while (wsrep_replaying > 0 && !wsrep_is_bf_aborted(m_thd)) { - mysql_cond_wait(&COND_wsrep_replaying, &LOCK_wsrep_replaying); + struct timespec wait_time; + set_timespec_nsec(wait_time, 10000000L); + mysql_cond_timedwait(&COND_wsrep_replaying, &LOCK_wsrep_replaying, + &wait_time); } mysql_mutex_unlock(&LOCK_wsrep_replaying); lock.lock(); |