From e6d78c380d29b903f475d3bcfc2ffd5b4b90a3ad Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Tue, 3 Jul 2018 08:58:25 +0300 Subject: [PATCH] Pass ws_meta to high priority service apply_toi --- dbsim/db_high_priority_service.cpp | 4 +++- dbsim/db_high_priority_service.hpp | 2 +- include/wsrep/high_priority_service.hpp | 3 ++- src/server_state.cpp | 2 +- test/mock_high_priority_service.cpp | 3 ++- test/mock_high_priority_service.hpp | 3 ++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dbsim/db_high_priority_service.cpp b/dbsim/db_high_priority_service.cpp index 1f9b58d..5861526 100644 --- a/dbsim/db_high_priority_service.cpp +++ b/dbsim/db_high_priority_service.cpp @@ -32,7 +32,9 @@ int db::high_priority_service::apply_write_set(const wsrep::const_buffer&) return 0; } -int db::high_priority_service::apply_toi(const wsrep::const_buffer&) +int db::high_priority_service::apply_toi( + const wsrep::ws_meta&, + const wsrep::const_buffer&) { throw wsrep::not_implemented_error(); } diff --git a/dbsim/db_high_priority_service.hpp b/dbsim/db_high_priority_service.hpp index 80c5be7..d18653a 100644 --- a/dbsim/db_high_priority_service.hpp +++ b/dbsim/db_high_priority_service.hpp @@ -21,7 +21,7 @@ namespace db int apply_write_set(const wsrep::const_buffer&) override; int commit() override; int rollback() override; - int apply_toi(const wsrep::const_buffer&) override; + int apply_toi(const wsrep::ws_meta&, const wsrep::const_buffer&) override; void after_apply() override; void store_globals() override { } void reset_globals() override { } diff --git a/include/wsrep/high_priority_service.hpp b/include/wsrep/high_priority_service.hpp index 7cc8022..c8248c1 100644 --- a/include/wsrep/high_priority_service.hpp +++ b/include/wsrep/high_priority_service.hpp @@ -65,7 +65,8 @@ namespace wsrep * TOI operation is a standalone operation and should not * be executed as a part of a transaction. */ - virtual int apply_toi(const wsrep::const_buffer&) = 0; + virtual int apply_toi(const wsrep::ws_meta&, + const wsrep::const_buffer&) = 0; /** * Actions to take after applying a write set was completed. diff --git a/src/server_state.cpp b/src/server_state.cpp index c55168c..ed43e6c 100644 --- a/src/server_state.cpp +++ b/src/server_state.cpp @@ -180,7 +180,7 @@ namespace { // Regular toi provider.commit_order_enter(ws_handle, ws_meta); - int ret(high_priority_service.apply_toi(data)); + int ret(high_priority_service.apply_toi(ws_meta, data)); provider.commit_order_leave(ws_handle, ws_meta); return ret; } diff --git a/test/mock_high_priority_service.cpp b/test/mock_high_priority_service.cpp index 27adfaa..6bd1e32 100644 --- a/test/mock_high_priority_service.cpp +++ b/test/mock_high_priority_service.cpp @@ -54,7 +54,8 @@ int wsrep::mock_high_priority_service::rollback() client_state_->after_rollback()); } -int wsrep::mock_high_priority_service::apply_toi(const wsrep::const_buffer&) +int wsrep::mock_high_priority_service::apply_toi(const wsrep::ws_meta&, + const wsrep::const_buffer&) { assert(client_state_->transaction().active() == false); assert(client_state_->toi_meta().seqno().is_undefined() == false); diff --git a/test/mock_high_priority_service.hpp b/test/mock_high_priority_service.hpp index 9f7daf0..e1e7467 100644 --- a/test/mock_high_priority_service.hpp +++ b/test/mock_high_priority_service.hpp @@ -35,7 +35,8 @@ namespace wsrep int apply_write_set(const wsrep::const_buffer&) WSREP_OVERRIDE; int commit() WSREP_OVERRIDE; int rollback() WSREP_OVERRIDE; - int apply_toi(const wsrep::const_buffer&) WSREP_OVERRIDE; + int apply_toi(const wsrep::ws_meta&, + const wsrep::const_buffer&) WSREP_OVERRIDE; void after_apply() WSREP_OVERRIDE; void store_globals() WSREP_OVERRIDE { } void reset_globals() WSREP_OVERRIDE { }