1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Release TOI critical section in poll_enter_toi() in case of error.

This commit is contained in:
Teemu Ollakka
2019-09-05 16:34:13 +03:00
parent 4ff55088b1
commit 58cea10577

View File

@ -344,6 +344,20 @@ wsrep::client_state::poll_enter_toi(
{
lock.unlock();
status = provider().enter_toi(id_, keys, buffer, toi_meta_, flags);
if (status != wsrep::provider::success &&
not toi_meta_.gtid().is_undefined())
{
// Successfully entered TOI, but the provider reported failure.
// This may happen for example if certification fails.
// Leave TOI before proceeding.
if (provider().leave_toi(id_, wsrep::mutable_buffer()))
{
wsrep::log_warning()
<< "Failed to leave TOI after failure in "
<< "poll_enter_toi()";
}
toi_meta_ = wsrep::ws_meta();
}
if (status == wsrep::provider::error_certification_failed)
{
::usleep(100000);