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

Fix NBO error handling

- Set both current error and current error status if provider enter_toi()
  or leave_toi() fails.
- Leave NBO mode if TOI cannot be entered in begin_nbo_phase_two().
This commit is contained in:
Teemu Ollakka
2019-09-05 15:15:30 +03:00
parent e700ce8c79
commit 4ff55088b1

View File

@ -516,8 +516,7 @@ int wsrep::client_state::begin_nbo_phase_one(
ret= 0; ret= 0;
break; break;
default: default:
override_error(e_deadlock_error); override_error(e_deadlock_error, status);
current_error_status_ = status;
if (!toi_meta_.seqno().is_undefined()) if (!toi_meta_.seqno().is_undefined())
{ {
// TODO(leandro): do we need to pass sth here? is leave_toi necessary here? enter_toi_local doesn't do it. // TODO(leandro): do we need to pass sth here? is leave_toi necessary here? enter_toi_local doesn't do it.
@ -548,7 +547,7 @@ int wsrep::client_state::end_nbo_phase_one(const wsrep::mutable_buffer& err)
ret = 0; ret = 0;
break; break;
default: default:
current_error_status_ = status; override_error(e_error_during_commit, status);
ret = 1; ret = 1;
break; break;
} }
@ -596,7 +595,11 @@ int wsrep::client_state::begin_nbo_phase_two()
toi_mode_ = m_local; toi_mode_ = m_local;
break; break;
default: default:
current_error_status_ = status; override_error(e_error_during_commit, status);
// Failed to grab TOI for completing NBO in order. This means that
// the operation cannot be ended in total order, so we end the
// NBO mode and let the DBMS to deal with the error.
mode(lock, m_local);
ret= 1; ret= 1;
break; break;
} }
@ -621,7 +624,7 @@ int wsrep::client_state::end_nbo_phase_two(const wsrep::mutable_buffer& err)
ret = 0; ret = 0;
break; break;
default: default:
current_error_status_ = status; override_error(e_error_during_commit, status);
ret = 1; ret = 1;
break; break;
} }