diff --git a/dbsim/db_client_service.cpp b/dbsim/db_client_service.cpp index 124063f..edf7df8 100644 --- a/dbsim/db_client_service.cpp +++ b/dbsim/db_client_service.cpp @@ -41,11 +41,11 @@ enum wsrep::provider::status db::client_service::replay() { wsrep::high_priority_context high_priority_context(client_state_); - db::high_priority_service high_priority_service( + db::replayer_service replayer_service( client_.server_, client_); auto ret(client_state_.provider().replay( client_state_.transaction().ws_handle(), - &high_priority_service)); + &replayer_service)); if (ret == wsrep::provider::success) { ++client_.stats_.replays; diff --git a/dbsim/db_high_priority_service.cpp b/dbsim/db_high_priority_service.cpp index 0d2636f..8e05e75 100644 --- a/dbsim/db_high_priority_service.cpp +++ b/dbsim/db_high_priority_service.cpp @@ -108,5 +108,5 @@ int db::high_priority_service::log_dummy_write_set( bool db::high_priority_service::is_replaying() const { - return (client_.client_state_.transaction().state() == wsrep::transaction::s_replaying); + return false; } diff --git a/dbsim/db_high_priority_service.hpp b/dbsim/db_high_priority_service.hpp index 5bb4a78..07df781 100644 --- a/dbsim/db_high_priority_service.hpp +++ b/dbsim/db_high_priority_service.hpp @@ -46,14 +46,14 @@ namespace db int commit(const wsrep::ws_handle&, const wsrep::ws_meta&) override; int rollback(const wsrep::ws_handle&, const wsrep::ws_meta&) override; int apply_toi(const wsrep::ws_meta&, const wsrep::const_buffer&) override; - void after_apply() override; + virtual void after_apply() override; void store_globals() override { } void reset_globals() override { } void switch_execution_context(wsrep::high_priority_service&) override { } int log_dummy_write_set(const wsrep::ws_handle&, const wsrep::ws_meta&) override; - bool is_replaying() const override; + virtual bool is_replaying() const override; void debug_crash(const char*) override { } private: high_priority_service(const high_priority_service&); @@ -61,6 +61,20 @@ namespace db db::server& server_; db::client& client_; }; + + class replayer_service : public db::high_priority_service + { + public: + replayer_service(db::server& server, db::client& client) + : db::high_priority_service(server, client) + { } + // After apply is empty for replayer to keep the transaction + // context available for the client session after replaying + // is over. + void after_apply() override { } + bool is_replaying() const override { return true; } + }; + } #endif // WSREP_DB_HIGH_PRIORITY_SERVICE_HPP