1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-06-16 02:01:44 +03:00

Renamed SST related interface methods.

This commit is contained in:
Teemu Ollakka
2018-05-07 19:04:41 +03:00
parent abf8ef34fc
commit db5bcb50ef
4 changed files with 33 additions and 24 deletions

View File

@ -238,22 +238,18 @@ public:
}
bool sst_before_init() const override { return false; }
std::string on_sst_request()
std::string on_sst_required()
{
return id();
}
void on_sst_donate_request(const std::string& req,
void on_sst_request(const std::string& req,
const wsrep_gtid_t& gtid,
bool bypass)
{
simulator_.donate_sst(*this, req, gtid, bypass);
}
void sst_sent(const wsrep_gtid_t& gtid)
{
provider().sst_sent(gtid, 0);
}
// Client context management
trrep::client_context* local_client_context();
@ -669,8 +665,8 @@ void dbms_simulator::donate_sst(dbms_server& server,
{
trrep::log() << "SST " << server.id() << " -> " << id;
}
i->second->sst_received(gtid);
server.sst_sent(gtid);
i->second->sst_received(gtid, 0);
server.sst_sent(gtid, 0);
}
std::string dbms_simulator::build_cluster_address() const
{

View File

@ -39,11 +39,11 @@ namespace trrep
void on_view(const trrep::view&) TRREP_OVERRIDE { }
void on_sync() TRREP_OVERRIDE { }
bool sst_before_init() const TRREP_OVERRIDE { return false; }
std::string on_sst_request() TRREP_OVERRIDE { return ""; }
void on_sst_donate_request(const std::string&,
std::string on_sst_required() TRREP_OVERRIDE { return ""; }
void on_sst_request(const std::string&,
const wsrep_gtid_t&,
bool) TRREP_OVERRIDE { }
void sst_received(const wsrep_gtid_t&) TRREP_OVERRIDE { }
// void sst_received(const wsrep_gtid_t&, int) TRREP_OVERRIDE { }
// void on_apply(trrep::transaction_context&) { }
// void on_commit(trrep::transaction_context&) { }

View File

@ -90,7 +90,7 @@ namespace
try
{
std::string req(server_context.on_sst_request());
std::string req(server_context.on_sst_required());
*sst_req = ::strdup(req.c_str());
*sst_req_len = strlen(req.c_str());
return WSREP_CB_SUCCESS;
@ -161,7 +161,7 @@ namespace
{
std::string req(reinterpret_cast<const char*>(req_buf->ptr),
req_buf->len);
server_context.on_sst_donate_request(req, *gtid, bypass);
server_context.on_sst_request(req, *gtid, bypass);
return WSREP_CB_SUCCESS;
}
catch (const trrep::runtime_error& e)
@ -232,9 +232,13 @@ trrep::server_context::~server_context()
delete provider_;
}
void trrep::server_context::sst_received(const wsrep_gtid_t& gtid)
void trrep::server_context::sst_sent(const wsrep_gtid_t& gtid, int error)
{
provider_->sst_received(gtid, 0);
provider_->sst_sent(gtid, error);
}
void trrep::server_context::sst_received(const wsrep_gtid_t& gtid, int error)
{
provider_->sst_received(gtid, error);
}
void trrep::server_context::wait_until_state(

View File

@ -272,7 +272,7 @@ namespace trrep
* provide a string containing an information which the donor
* server can use to donate SST.
*/
virtual std::string on_sst_request() = 0;
virtual std::string on_sst_required() = 0;
/*!
* Virtual method which will be called on *donor* when the
@ -294,18 +294,27 @@ namespace trrep
* \param gtid GTID denoting the current replication position.
* \param bypass Boolean bypass flag.
*/
virtual void on_sst_donate_request(const std::string& sst_request,
virtual void on_sst_request(const std::string& sst_request,
const wsrep_gtid_t& gtid,
bool bypass) = 0;
/*!
*
*/
void sst_sent(const wsrep_gtid_t& gtid, int error);
/*!
* This method must be called by the joiner after the SST
* transfer has been received.
*
* \param gtid GTID provided by the SST transfer
*/
void sst_received(const wsrep_gtid_t& gtid);
void sst_received(const wsrep_gtid_t& gtid, int error);
/*!
*
*/
/*!
* This method will be called by the provider hen
* a remote write set is being applied. It is the responsibility