1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-08-05 04:01:12 +03:00

Fixes to local streaming replication processing.

This commit is contained in:
Teemu Ollakka
2018-07-08 15:27:49 +03:00
parent 2913aecebd
commit 7c424d8337
12 changed files with 122 additions and 75 deletions

View File

@@ -463,6 +463,20 @@ void wsrep::server_state::on_view(const wsrep::view& view)
if (view.status() == wsrep::view::primary)
{
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
if (view.own_index() >= 0)
{
if (id_.is_undefined())
{
// No identifier was passed during server state initialization
// and the ID was generated by the provider.
id_ = view.members()[view.own_index()].id();
}
else
{
// Own identifier must not change between views.
// assert(id_ == view.members()[view.own_index()].id());
}
}
assert(view.final() == false);
//
@@ -555,6 +569,7 @@ void wsrep::server_state::on_view(const wsrep::view& view)
assert(view.final());
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
state(lock, s_disconnected);
id_ = wsrep::id::undefined();
}
}