1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-30 07:23:07 +03:00

codership/wsrep-lib#54 Service call to recover streaming appliers

Introduced server_service recover_streaming_appliers() interface
call which will be called in total order whenever streaming appliers
must be recovered. The call comes with two overloads, one which
can be called from client context (e.g. after SST has been received)
and the other from high priority context (e.g. view event handling).

The client context overload should be eventually be deprecated once
there is a mechanism to make provider signal that it has joined to
the cluster and will start applying events.
This commit is contained in:
Teemu Ollakka
2019-01-18 14:02:58 +02:00
parent 144d8c13c1
commit a6b38d2428
7 changed files with 91 additions and 2 deletions

View File

@ -20,6 +20,7 @@
#ifndef WSREP_STREAMING_CONTEXT_HPP
#define WSREP_STREAMING_CONTEXT_HPP
#include "compiler.hpp"
#include "logger.hpp"
#include "seqno.hpp"
#include "transaction_id.hpp"
@ -80,7 +81,7 @@ namespace wsrep
void stored(wsrep::seqno seqno)
{
assert(seqno.is_undefined() == false);
check_fragment_seqno(seqno);
fragments_.push_back(seqno);
}
@ -91,7 +92,7 @@ namespace wsrep
void applied(wsrep::seqno seqno)
{
assert(seqno.is_undefined() == false);
check_fragment_seqno(seqno);
++fragments_certified_;
fragments_.push_back(seqno);
}
@ -152,6 +153,13 @@ namespace wsrep
unit_counter_ = 0;
}
private:
void check_fragment_seqno(wsrep::seqno seqno WSREP_UNUSED)
{
assert(seqno.is_undefined() == false);
assert(fragments_.empty() || fragments_.back() < seqno);
}
size_t fragments_certified_;
std::vector<wsrep::seqno> fragments_;
wsrep::transaction_id rollback_replicated_for_;