From 043ff7a7e950adfcf43876297f7346e2246aa1d1 Mon Sep 17 00:00:00 2001 From: Leandro Pacheco Date: Tue, 17 Sep 2019 16:52:29 -0300 Subject: [PATCH] remove has_error arg from begin_nbo_phase_two --- include/wsrep/client_state.hpp | 2 -- src/client_state.cpp | 8 +------- test/nbo_test.cpp | 4 ++-- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/include/wsrep/client_state.hpp b/include/wsrep/client_state.hpp index 79d9e1b..40a0e33 100644 --- a/include/wsrep/client_state.hpp +++ b/include/wsrep/client_state.hpp @@ -790,12 +790,10 @@ namespace wsrep * passed to begin_nbo_phase_one(). * * @param keys Key array. - * @param has_error True if client thread has errored. * @param wait_until Time point to wait until for entering TOI for * phase two. */ int begin_nbo_phase_two(const wsrep::key_array& keys, - bool has_error, std::chrono::time_point wait_until = std::chrono::time_point()); diff --git a/src/client_state.cpp b/src/client_state.cpp index 32ae3cb..c2b22d4 100644 --- a/src/client_state.cpp +++ b/src/client_state.cpp @@ -615,7 +615,6 @@ int wsrep::client_state::enter_nbo_mode(const wsrep::ws_meta& ws_meta) int wsrep::client_state::begin_nbo_phase_two( const wsrep::key_array& keys, - bool has_error, std::chrono::time_point wait_until) { debug_log_state("begin_nbo_phase_two: enter"); @@ -647,12 +646,7 @@ int wsrep::client_state::begin_nbo_phase_two( toi_mode_ = m_local; break; case wsrep::provider::error_provider_failed: - // If the thread has already errored on the DBMS side, we - // don't override the error so the original one can be reported. - if (!has_error) - { - override_error(e_interrupted_error, status); - } + override_error(e_interrupted_error, status); ret= 1; break; default: diff --git a/test/nbo_test.cpp b/test/nbo_test.cpp index 516b4f2..238a4da 100644 --- a/test/nbo_test.cpp +++ b/test/nbo_test.cpp @@ -50,7 +50,7 @@ BOOST_FIXTURE_TEST_CASE(test_local_nbo, BOOST_REQUIRE(cc.toi_mode() == wsrep::client_state::m_undefined); // Second phase replicates the NBO end event and grabs TOI // again for finalizing the NBO. - BOOST_REQUIRE(cc.begin_nbo_phase_two(keys, false) == 0); + BOOST_REQUIRE(cc.begin_nbo_phase_two(keys) == 0); BOOST_REQUIRE(cc.mode() == wsrep::client_state::m_nbo); BOOST_REQUIRE(cc.in_toi()); BOOST_REQUIRE(cc.toi_mode() == wsrep::client_state::m_local); @@ -126,7 +126,7 @@ BOOST_FIXTURE_TEST_CASE(test_applying_nbo, key.append_key_part("k2", 2); wsrep::key_array keys{key}; // Starting phase two should put nbo_cs in toi mode. - BOOST_REQUIRE(nbo_cs->begin_nbo_phase_two(keys, false) == 0); + BOOST_REQUIRE(nbo_cs->begin_nbo_phase_two(keys) == 0); BOOST_REQUIRE(nbo_cs->mode() == wsrep::client_state::m_nbo); BOOST_REQUIRE(nbo_cs->in_toi()); BOOST_REQUIRE(nbo_cs->toi_mode() == wsrep::client_state::m_local);