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:
@ -238,22 +238,18 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool sst_before_init() const override { return false; }
|
bool sst_before_init() const override { return false; }
|
||||||
std::string on_sst_request()
|
std::string on_sst_required()
|
||||||
{
|
{
|
||||||
return id();
|
return id();
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_sst_donate_request(const std::string& req,
|
void on_sst_request(const std::string& req,
|
||||||
const wsrep_gtid_t& gtid,
|
const wsrep_gtid_t& gtid,
|
||||||
bool bypass)
|
bool bypass)
|
||||||
{
|
{
|
||||||
simulator_.donate_sst(*this, req, gtid, bypass);
|
simulator_.donate_sst(*this, req, gtid, bypass);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sst_sent(const wsrep_gtid_t& gtid)
|
|
||||||
{
|
|
||||||
provider().sst_sent(gtid, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Client context management
|
// Client context management
|
||||||
trrep::client_context* local_client_context();
|
trrep::client_context* local_client_context();
|
||||||
@ -669,8 +665,8 @@ void dbms_simulator::donate_sst(dbms_server& server,
|
|||||||
{
|
{
|
||||||
trrep::log() << "SST " << server.id() << " -> " << id;
|
trrep::log() << "SST " << server.id() << " -> " << id;
|
||||||
}
|
}
|
||||||
i->second->sst_received(gtid);
|
i->second->sst_received(gtid, 0);
|
||||||
server.sst_sent(gtid);
|
server.sst_sent(gtid, 0);
|
||||||
}
|
}
|
||||||
std::string dbms_simulator::build_cluster_address() const
|
std::string dbms_simulator::build_cluster_address() const
|
||||||
{
|
{
|
||||||
|
@ -39,11 +39,11 @@ namespace trrep
|
|||||||
void on_view(const trrep::view&) TRREP_OVERRIDE { }
|
void on_view(const trrep::view&) TRREP_OVERRIDE { }
|
||||||
void on_sync() TRREP_OVERRIDE { }
|
void on_sync() TRREP_OVERRIDE { }
|
||||||
bool sst_before_init() const TRREP_OVERRIDE { return false; }
|
bool sst_before_init() const TRREP_OVERRIDE { return false; }
|
||||||
std::string on_sst_request() TRREP_OVERRIDE { return ""; }
|
std::string on_sst_required() TRREP_OVERRIDE { return ""; }
|
||||||
void on_sst_donate_request(const std::string&,
|
void on_sst_request(const std::string&,
|
||||||
const wsrep_gtid_t&,
|
const wsrep_gtid_t&,
|
||||||
bool) TRREP_OVERRIDE { }
|
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_apply(trrep::transaction_context&) { }
|
||||||
// void on_commit(trrep::transaction_context&) { }
|
// void on_commit(trrep::transaction_context&) { }
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ namespace
|
|||||||
|
|
||||||
try
|
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 = ::strdup(req.c_str());
|
||||||
*sst_req_len = strlen(req.c_str());
|
*sst_req_len = strlen(req.c_str());
|
||||||
return WSREP_CB_SUCCESS;
|
return WSREP_CB_SUCCESS;
|
||||||
@ -161,7 +161,7 @@ namespace
|
|||||||
{
|
{
|
||||||
std::string req(reinterpret_cast<const char*>(req_buf->ptr),
|
std::string req(reinterpret_cast<const char*>(req_buf->ptr),
|
||||||
req_buf->len);
|
req_buf->len);
|
||||||
server_context.on_sst_donate_request(req, *gtid, bypass);
|
server_context.on_sst_request(req, *gtid, bypass);
|
||||||
return WSREP_CB_SUCCESS;
|
return WSREP_CB_SUCCESS;
|
||||||
}
|
}
|
||||||
catch (const trrep::runtime_error& e)
|
catch (const trrep::runtime_error& e)
|
||||||
@ -232,9 +232,13 @@ trrep::server_context::~server_context()
|
|||||||
delete provider_;
|
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(
|
void trrep::server_context::wait_until_state(
|
||||||
|
@ -272,7 +272,7 @@ namespace trrep
|
|||||||
* provide a string containing an information which the donor
|
* provide a string containing an information which the donor
|
||||||
* server can use to donate SST.
|
* 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
|
* 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 gtid GTID denoting the current replication position.
|
||||||
* \param bypass Boolean bypass flag.
|
* \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,
|
const wsrep_gtid_t& gtid,
|
||||||
bool bypass) = 0;
|
bool bypass) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void sst_sent(const wsrep_gtid_t& gtid, int error);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* This method must be called by the joiner after the SST
|
* This method must be called by the joiner after the SST
|
||||||
* transfer has been received.
|
* transfer has been received.
|
||||||
*
|
*
|
||||||
* \param gtid GTID provided by the SST transfer
|
* \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
|
* This method will be called by the provider hen
|
||||||
* a remote write set is being applied. It is the responsibility
|
* a remote write set is being applied. It is the responsibility
|
||||||
|
Reference in New Issue
Block a user