mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Add method client_state::stream()
This method forces a streaming replication step.
This commit is contained in:
@ -354,6 +354,14 @@ namespace wsrep
|
|||||||
*/
|
*/
|
||||||
int after_row();
|
int after_row();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Force a streaming step
|
||||||
|
*
|
||||||
|
* This method can be used to replicate a fragment in the
|
||||||
|
* current context.
|
||||||
|
*/
|
||||||
|
int stream();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set streaming parameters.
|
* Set streaming parameters.
|
||||||
*
|
*
|
||||||
|
@ -175,6 +175,8 @@ namespace wsrep
|
|||||||
|
|
||||||
int after_row();
|
int after_row();
|
||||||
|
|
||||||
|
int stream();
|
||||||
|
|
||||||
int before_prepare(wsrep::unique_lock<wsrep::mutex>&);
|
int before_prepare(wsrep::unique_lock<wsrep::mutex>&);
|
||||||
|
|
||||||
int after_prepare(wsrep::unique_lock<wsrep::mutex>&);
|
int after_prepare(wsrep::unique_lock<wsrep::mutex>&);
|
||||||
|
@ -336,6 +336,13 @@ int wsrep::client_state::after_row()
|
|||||||
: 0);
|
: 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wsrep::client_state::stream()
|
||||||
|
{
|
||||||
|
assert(mode_ == m_local);
|
||||||
|
assert(state_ == s_exec);
|
||||||
|
return transaction_.stream();
|
||||||
|
}
|
||||||
|
|
||||||
void wsrep::client_state::fragment_applied(wsrep::seqno seqno)
|
void wsrep::client_state::fragment_applied(wsrep::seqno seqno)
|
||||||
{
|
{
|
||||||
assert(mode_ == m_high_priority);
|
assert(mode_ == m_high_priority);
|
||||||
|
@ -273,6 +273,15 @@ int wsrep::transaction::after_row()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wsrep::transaction::stream()
|
||||||
|
{
|
||||||
|
wsrep::unique_lock<wsrep::mutex> lock(client_state_.mutex());
|
||||||
|
debug_log_state("stream_enter");
|
||||||
|
int ret(streaming_step(lock, true));
|
||||||
|
debug_log_state("stream_leave");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int wsrep::transaction::before_prepare(
|
int wsrep::transaction::before_prepare(
|
||||||
wsrep::unique_lock<wsrep::mutex>& lock)
|
wsrep::unique_lock<wsrep::mutex>& lock)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user