mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-04-25 17:42:30 +03:00
Deprecated sst_transferred(), always use sst_received()
This commit is contained in:
parent
e6d78c380d
commit
c552d944ed
@ -36,9 +36,7 @@ void db::simulator::sst(db::server& server,
|
||||
{
|
||||
wsrep::log_info() << "SST " << server.server_state().id() << " -> " << id;
|
||||
}
|
||||
i->second->server_state().sst_transferred(gtid);
|
||||
// i->second->server_state().initialized();
|
||||
// i->second->server_state().sst_received(gtid, 0);
|
||||
i->second->server_state().sst_received(gtid, 0);
|
||||
server.server_state().sst_sent(gtid, 0);
|
||||
}
|
||||
|
||||
|
@ -65,8 +65,6 @@ namespace wsrep
|
||||
* new cluster is bootstrapped and the server has reached
|
||||
* initialized state. From this call the DBMS should initialize
|
||||
* environment for the new cluster.
|
||||
*
|
||||
* @param gtid Gtid of the bootstrap position.
|
||||
*/
|
||||
virtual void bootstrap() = 0;
|
||||
|
||||
|
@ -396,18 +396,11 @@ namespace wsrep
|
||||
*/
|
||||
void sst_sent(const wsrep::gtid& gtid, int error);
|
||||
|
||||
/**
|
||||
* This method should be called on joiner after the
|
||||
* SST has been transferred but before DBMS has been
|
||||
* initialized.
|
||||
*/
|
||||
void sst_transferred(const wsrep::gtid& gtid);
|
||||
|
||||
/**
|
||||
* This method must be called by the joiner after the SST
|
||||
* transfer has been received and DBMS state has been completely
|
||||
* initialized. This will signal the provider that it can
|
||||
* start applying write sets.
|
||||
* transfer has been received. If the DBMS state has not been
|
||||
* initialized, the call will shift the state to initializing
|
||||
* and will wait until the initialization is complete.
|
||||
*
|
||||
* @param gtid GTID provided by the SST transfer
|
||||
*/
|
||||
|
@ -349,19 +349,22 @@ void wsrep::server_state::sst_sent(const wsrep::gtid& gtid, int error)
|
||||
}
|
||||
}
|
||||
|
||||
void wsrep::server_state::sst_transferred(const wsrep::gtid& gtid)
|
||||
void wsrep::server_state::sst_received(const wsrep::gtid& gtid, int error)
|
||||
{
|
||||
wsrep::log_info() << "SST transferred: " << gtid;
|
||||
wsrep::log_info() << "SST received: " << gtid;
|
||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||
sst_gtid_ = gtid;
|
||||
assert(state_ == s_joiner || state_ == s_initialized);
|
||||
if (server_service_.sst_before_init())
|
||||
{
|
||||
state(lock, s_initializing);
|
||||
wait_until_state(lock, s_initialized);
|
||||
assert(init_initialized_);
|
||||
if (init_initialized_ == false)
|
||||
{
|
||||
state(lock, s_initializing);
|
||||
wait_until_state(lock, s_initialized);
|
||||
assert(init_initialized_);
|
||||
}
|
||||
state(lock, s_joined);
|
||||
lock.unlock();
|
||||
if (provider().sst_received(sst_gtid_, 0))
|
||||
if (provider().sst_received(gtid, error))
|
||||
{
|
||||
throw wsrep::runtime_error("SST received failed");
|
||||
}
|
||||
@ -369,19 +372,10 @@ void wsrep::server_state::sst_transferred(const wsrep::gtid& gtid)
|
||||
else
|
||||
{
|
||||
state(lock, s_joined);
|
||||
}
|
||||
}
|
||||
|
||||
void wsrep::server_state::sst_received(const wsrep::gtid& gtid, int error)
|
||||
{
|
||||
assert(0);
|
||||
wsrep::log_info() << "SST received: " << gtid << ": " << error;
|
||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||
state(lock, s_joined);
|
||||
lock.unlock();
|
||||
if (provider_->sst_received(gtid, error))
|
||||
{
|
||||
throw wsrep::runtime_error("SST received failed");
|
||||
if (provider().sst_received(gtid, error))
|
||||
{
|
||||
throw wsrep::runtime_error("SST received failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user