From 4ff55088b1fa9cbdcfdf51749dc24d4a07eb6987 Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Thu, 5 Sep 2019 15:15:30 +0300 Subject: [PATCH] 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(). --- src/client_state.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/client_state.cpp b/src/client_state.cpp index d969c50..0a19567 100644 --- a/src/client_state.cpp +++ b/src/client_state.cpp @@ -516,8 +516,7 @@ int wsrep::client_state::begin_nbo_phase_one( ret= 0; break; default: - override_error(e_deadlock_error); - current_error_status_ = status; + override_error(e_deadlock_error, status); 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. @@ -548,7 +547,7 @@ int wsrep::client_state::end_nbo_phase_one(const wsrep::mutable_buffer& err) ret = 0; break; default: - current_error_status_ = status; + override_error(e_error_during_commit, status); ret = 1; break; } @@ -596,7 +595,11 @@ int wsrep::client_state::begin_nbo_phase_two() toi_mode_ = m_local; break; 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; break; } @@ -621,7 +624,7 @@ int wsrep::client_state::end_nbo_phase_two(const wsrep::mutable_buffer& err) ret = 0; break; default: - current_error_status_ = status; + override_error(e_error_during_commit, status); ret = 1; break; }