mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
fixing reviewer comments
- style fixes - small improvement to avoid unnecessary search on close_orphaned_sr
This commit is contained in:
@ -355,6 +355,7 @@ namespace wsrep
|
||||
* Return current view
|
||||
*/
|
||||
const wsrep::view& current_view() const { return current_view_; }
|
||||
|
||||
/**
|
||||
* Set last committed GTID.
|
||||
*/
|
||||
|
@ -887,21 +887,8 @@ void wsrep::server_state::on_view(const wsrep::view& view,
|
||||
{
|
||||
wsrep::log_info()
|
||||
<< "================================================\nView:\n"
|
||||
<< " id: " << view.state_id() << "\n"
|
||||
<< " seqno: " << view.view_seqno() << "\n"
|
||||
<< " status: " << view.status() << "\n"
|
||||
<< " protocol_version: " << view.protocol_version() << "\n"
|
||||
<< " own_index: " << view.own_index() << "\n"
|
||||
<< " final: " << view.final() << "\n"
|
||||
<< " members";
|
||||
const std::vector<wsrep::view::member>& members(view.members());
|
||||
for (std::vector<wsrep::view::member>::const_iterator i(members.begin());
|
||||
i != members.end(); ++i)
|
||||
{
|
||||
wsrep::log_info() << " id: " << i->id() << " "
|
||||
<< "name: " << i->name();
|
||||
}
|
||||
wsrep::log_info() << "=================================================";
|
||||
<< view
|
||||
<< "=================================================";
|
||||
if (current_view_.status() == wsrep::view::primary)
|
||||
{
|
||||
previous_primary_view_ = current_view_;
|
||||
@ -1309,12 +1296,13 @@ void wsrep::server_state::close_orphaned_sr_transactions(
|
||||
streaming_appliers_map::iterator i(streaming_appliers_.begin());
|
||||
while (i != streaming_appliers_.end())
|
||||
{
|
||||
bool origin_not_in_view = std::find_if(current_view_.members().begin(),
|
||||
// rollback SR on equal consecutive primary views or if its
|
||||
// originator is not in the current view
|
||||
if (equal_consecutive_views ||
|
||||
(std::find_if(current_view_.members().begin(),
|
||||
current_view_.members().end(),
|
||||
server_id_cmp(i->first.first)) ==
|
||||
current_view_.members().end();
|
||||
|
||||
if (origin_not_in_view || equal_consecutive_views)
|
||||
current_view_.members().end()))
|
||||
{
|
||||
WSREP_LOG_DEBUG(wsrep::log::debug_log_level(),
|
||||
wsrep::log::debug_level_server_state,
|
||||
|
@ -43,7 +43,8 @@ bool wsrep::view::equal_membership(const wsrep::view& other) const
|
||||
for (std::vector<member>::const_iterator i(members_.begin());
|
||||
i != members_.end(); ++i)
|
||||
{
|
||||
if (other.member_index(i->id()) == -1) {
|
||||
if (other.member_index(i->id()) == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -54,7 +55,7 @@ void wsrep::view::print(std::ostream& os) const
|
||||
{
|
||||
os << " id: " << state_id() << "\n"
|
||||
<< " status: " << to_c_string(status()) << "\n"
|
||||
<< " prococol_version: " << protocol_version() << "\n"
|
||||
<< " protocol_version: " << protocol_version() << "\n"
|
||||
<< " capabilities: " << provider::capability::str(capabilities())<<"\n"
|
||||
<< " final: " << (final() ? "yes" : "no") << "\n"
|
||||
<< " own_index: " << own_index() << "\n"
|
||||
|
Reference in New Issue
Block a user