diff --git a/include/wsrep/client_service.hpp b/include/wsrep/client_service.hpp index d47396d..93cf70d 100644 --- a/include/wsrep/client_service.hpp +++ b/include/wsrep/client_service.hpp @@ -217,6 +217,14 @@ namespace wsrep * been enabled. */ virtual void debug_crash(const char* crash_point) = 0; + +#ifdef WITH_WSREP_SR_SPEEDUP + /** + * Return the binlog cache for the currently execution + * transaction or a NULL pointer if no such cache exists. + */ + virtual void *get_binlog_cache() = 0; +#endif /* WITH_WSREP_SR_SPEEDUP */ }; } diff --git a/include/wsrep/storage_service.hpp b/include/wsrep/storage_service.hpp index 3ef43d8..11d4e71 100644 --- a/include/wsrep/storage_service.hpp +++ b/include/wsrep/storage_service.hpp @@ -67,7 +67,8 @@ namespace wsrep const wsrep::const_buffer& data, #ifdef WITH_WSREP_SR_SPEEDUP_REPLAY size_t offset, - const wsrep::xid& xid, void * current_thd) = 0; + const wsrep::xid& xid, + void *binlog_cache) = 0; #else const wsrep::xid& xid) = 0; #endif /* WITH_WSREP_SR_SPEEDUP_REPLAY */ diff --git a/include/wsrep/transaction.hpp b/include/wsrep/transaction.hpp index a3480f0..0ebc1f0 100644 --- a/include/wsrep/transaction.hpp +++ b/include/wsrep/transaction.hpp @@ -144,6 +144,7 @@ namespace wsrep int xa_replay(wsrep::unique_lock&); #ifdef WITH_WSREP_SR_SPEEDUP int set_fragments_from_table(); + void *get_binlog_cache(); #endif /* WITH_WSREP_SR_SPEEDUP */ bool pa_unsafe() const { return pa_unsafe_; } diff --git a/src/server_state.cpp b/src/server_state.cpp index 1f17b71..7efead0 100644 --- a/src/server_state.cpp +++ b/src/server_state.cpp @@ -1260,9 +1260,10 @@ void wsrep::server_state::start_streaming_applier( wsrep::high_priority_service* sa) { wsrep::unique_lock lock(mutex_); -#ifdef DEBUG_SR_SPEEDUP2 - wsrep::log_warning() << "start_streaming_applier"; -#endif /* DEBUG_SR_SPEEDUP2 */ +#ifdef DEBUG_SR_SPEEDUP + wsrep::log_info() << "start_streaming_applier: wsrep_trx_id = " + << transaction_id; +#endif /* DEBUG_SR_SPEEDUP */ if (streaming_appliers_.insert( std::make_pair(std::make_pair(server_id, transaction_id), sa)).second == false) diff --git a/src/transaction.cpp b/src/transaction.cpp index 7d15296..139740c 100644 --- a/src/transaction.cpp +++ b/src/transaction.cpp @@ -1320,6 +1320,16 @@ int wsrep::transaction::set_fragments_from_table() return (rcode); } + +void *wsrep::transaction::get_binlog_cache() +{ + void *cache = client_service_.get_binlog_cache(); + + assert(cache); + + return (cache); +} + #endif /* WITH_WSREP_SR_SPEEDUP */ @@ -1611,7 +1621,7 @@ int wsrep::transaction::certify_fragment( wsrep::const_buffer(data.data(), data.size()), #ifdef WITH_WSREP_SR_SPEEDUP_REPLAY log_position - data.size(), - xid(), current_thd)) + xid(), get_binlog_cache())) #else xid())) #endif /* WITH_WSREP_SR_SPEEDUP_REPLAY */