mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-31 18:24:25 +03:00
The changes:
* merged most of Seppo's changes by hand * enabled the replay of SR speedup feature * changed how binlog_cache is retrieved for SR speedup * moved set_fragments_from_table() to Wsrep_schema::recover_sr_transactions() * improved handling the "wsrep_is_sr" flags Several MTR tests still fail, for example galera_sr.GCF-900
This commit is contained in:
@ -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 */
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -144,6 +144,7 @@ namespace wsrep
|
||||
int xa_replay(wsrep::unique_lock<wsrep::mutex>&);
|
||||
#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_; }
|
||||
|
@ -1260,9 +1260,10 @@ void wsrep::server_state::start_streaming_applier(
|
||||
wsrep::high_priority_service* sa)
|
||||
{
|
||||
wsrep::unique_lock<wsrep::mutex> 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)
|
||||
|
@ -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 */
|
||||
|
Reference in New Issue
Block a user