mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
Fixed dbsim SST issues.
This commit is contained in:
@ -19,9 +19,9 @@ void db::simulator::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void db::simulator::sst(db::server& server,
|
void db::simulator::sst(db::server& server,
|
||||||
const std::string& request,
|
const std::string& request,
|
||||||
const wsrep::gtid& gtid,
|
const wsrep::gtid& gtid,
|
||||||
bool bypass)
|
bool bypass)
|
||||||
{
|
{
|
||||||
size_t id;
|
size_t id;
|
||||||
std::istringstream is(request);
|
std::istringstream is(request);
|
||||||
@ -37,7 +37,7 @@ void db::simulator::sst(db::server& server,
|
|||||||
wsrep::log_info() << "SST " << server.server_state().id() << " -> " << id;
|
wsrep::log_info() << "SST " << server.server_state().id() << " -> " << id;
|
||||||
}
|
}
|
||||||
i->second->server_state().sst_transferred(gtid);
|
i->second->server_state().sst_transferred(gtid);
|
||||||
i->second->server_state().initialized();
|
// 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);
|
server.server_state().sst_sent(gtid, 0);
|
||||||
}
|
}
|
||||||
|
@ -357,19 +357,13 @@ void wsrep::server_state::sst_transferred(const wsrep::gtid& gtid)
|
|||||||
if (server_service_.sst_before_init())
|
if (server_service_.sst_before_init())
|
||||||
{
|
{
|
||||||
state(lock, s_initializing);
|
state(lock, s_initializing);
|
||||||
// Incremental state transfer was received
|
wait_until_state(lock, s_initialized);
|
||||||
// TODO: Sanity checks for gtid continuity
|
assert(init_initialized_);
|
||||||
if (init_initialized_)
|
state(lock, s_joined);
|
||||||
|
lock.unlock();
|
||||||
|
if (provider().sst_received(sst_gtid_, 0))
|
||||||
{
|
{
|
||||||
state(lock, s_initialized);
|
throw wsrep::runtime_error("SST received failed");
|
||||||
state(lock, s_joined);
|
|
||||||
lock.unlock();
|
|
||||||
// TODO: This should not be here, sst_received() should be
|
|
||||||
// called instead
|
|
||||||
if (provider().sst_received(sst_gtid_, 0))
|
|
||||||
{
|
|
||||||
throw wsrep::runtime_error("SST received failed");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -380,6 +374,7 @@ void wsrep::server_state::sst_transferred(const wsrep::gtid& gtid)
|
|||||||
|
|
||||||
void wsrep::server_state::sst_received(const wsrep::gtid& gtid, int error)
|
void wsrep::server_state::sst_received(const wsrep::gtid& gtid, int error)
|
||||||
{
|
{
|
||||||
|
assert(0);
|
||||||
wsrep::log_info() << "SST received: " << gtid << ": " << error;
|
wsrep::log_info() << "SST received: " << gtid << ": " << error;
|
||||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||||
state(lock, s_joined);
|
state(lock, s_joined);
|
||||||
@ -398,16 +393,6 @@ void wsrep::server_state::initialized()
|
|||||||
if (server_service_.sst_before_init())
|
if (server_service_.sst_before_init())
|
||||||
{
|
{
|
||||||
state(lock, s_initialized);
|
state(lock, s_initialized);
|
||||||
if (sst_gtid_.is_undefined() == false)
|
|
||||||
{
|
|
||||||
lock.unlock();
|
|
||||||
if (provider().sst_received(sst_gtid_, 0))
|
|
||||||
{
|
|
||||||
throw wsrep::runtime_error("SST received failed");
|
|
||||||
}
|
|
||||||
lock.lock();
|
|
||||||
sst_gtid_ = wsrep::gtid::undefined();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user