mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-08-06 15:02:41 +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.
|
* been enabled.
|
||||||
*/
|
*/
|
||||||
virtual void debug_crash(const char* crash_point) = 0;
|
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,
|
const wsrep::const_buffer& data,
|
||||||
#ifdef WITH_WSREP_SR_SPEEDUP_REPLAY
|
#ifdef WITH_WSREP_SR_SPEEDUP_REPLAY
|
||||||
size_t offset,
|
size_t offset,
|
||||||
const wsrep::xid& xid, void * current_thd) = 0;
|
const wsrep::xid& xid,
|
||||||
|
void *binlog_cache) = 0;
|
||||||
#else
|
#else
|
||||||
const wsrep::xid& xid) = 0;
|
const wsrep::xid& xid) = 0;
|
||||||
#endif /* WITH_WSREP_SR_SPEEDUP_REPLAY */
|
#endif /* WITH_WSREP_SR_SPEEDUP_REPLAY */
|
||||||
|
@@ -144,6 +144,7 @@ namespace wsrep
|
|||||||
int xa_replay(wsrep::unique_lock<wsrep::mutex>&);
|
int xa_replay(wsrep::unique_lock<wsrep::mutex>&);
|
||||||
#ifdef WITH_WSREP_SR_SPEEDUP
|
#ifdef WITH_WSREP_SR_SPEEDUP
|
||||||
int set_fragments_from_table();
|
int set_fragments_from_table();
|
||||||
|
void *get_binlog_cache();
|
||||||
#endif /* WITH_WSREP_SR_SPEEDUP */
|
#endif /* WITH_WSREP_SR_SPEEDUP */
|
||||||
|
|
||||||
bool pa_unsafe() const { return pa_unsafe_; }
|
bool pa_unsafe() const { return pa_unsafe_; }
|
||||||
|
@@ -1260,9 +1260,10 @@ void wsrep::server_state::start_streaming_applier(
|
|||||||
wsrep::high_priority_service* sa)
|
wsrep::high_priority_service* sa)
|
||||||
{
|
{
|
||||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||||
#ifdef DEBUG_SR_SPEEDUP2
|
#ifdef DEBUG_SR_SPEEDUP
|
||||||
wsrep::log_warning() << "start_streaming_applier";
|
wsrep::log_info() << "start_streaming_applier: wsrep_trx_id = "
|
||||||
#endif /* DEBUG_SR_SPEEDUP2 */
|
<< transaction_id;
|
||||||
|
#endif /* DEBUG_SR_SPEEDUP */
|
||||||
if (streaming_appliers_.insert(
|
if (streaming_appliers_.insert(
|
||||||
std::make_pair(std::make_pair(server_id, transaction_id),
|
std::make_pair(std::make_pair(server_id, transaction_id),
|
||||||
sa)).second == false)
|
sa)).second == false)
|
||||||
|
@@ -1320,6 +1320,16 @@ int wsrep::transaction::set_fragments_from_table()
|
|||||||
|
|
||||||
return (rcode);
|
return (rcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *wsrep::transaction::get_binlog_cache()
|
||||||
|
{
|
||||||
|
void *cache = client_service_.get_binlog_cache();
|
||||||
|
|
||||||
|
assert(cache);
|
||||||
|
|
||||||
|
return (cache);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* WITH_WSREP_SR_SPEEDUP */
|
#endif /* WITH_WSREP_SR_SPEEDUP */
|
||||||
|
|
||||||
|
|
||||||
@@ -1611,7 +1621,7 @@ int wsrep::transaction::certify_fragment(
|
|||||||
wsrep::const_buffer(data.data(), data.size()),
|
wsrep::const_buffer(data.data(), data.size()),
|
||||||
#ifdef WITH_WSREP_SR_SPEEDUP_REPLAY
|
#ifdef WITH_WSREP_SR_SPEEDUP_REPLAY
|
||||||
log_position - data.size(),
|
log_position - data.size(),
|
||||||
xid(), current_thd))
|
xid(), get_binlog_cache()))
|
||||||
#else
|
#else
|
||||||
xid()))
|
xid()))
|
||||||
#endif /* WITH_WSREP_SR_SPEEDUP_REPLAY */
|
#endif /* WITH_WSREP_SR_SPEEDUP_REPLAY */
|
||||||
|
Reference in New Issue
Block a user