From 5e4335d5a05205a6a5ffbc09c536a8e7647f141c Mon Sep 17 00:00:00 2001 From: Zhenyu Guo Date: Thu, 14 May 2015 09:50:07 +0800 Subject: [PATCH] nits --- src/apps/replication/lib/replica_config.cpp | 3 +-- src/apps/replication/lib/replica_stub.cpp | 10 +--------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/apps/replication/lib/replica_config.cpp b/src/apps/replication/lib/replica_config.cpp index 74c10e177c..cd45fe5447 100644 --- a/src/apps/replication/lib/replica_config.cpp +++ b/src/apps/replication/lib/replica_config.cpp @@ -101,13 +101,12 @@ void replica::assign_primary(configuration_update_request& proposal) void replica::add_potential_secondary(configuration_update_request& proposal) { - dassert(proposal.config.ballot == get_ballot(), ""); if (status() != PS_PRIMARY) { - dassert(status() == PS_INACTIVE, ""); return; } + dassert (proposal.config.ballot == get_ballot(), ""); dassert (proposal.config.gpid == _primary_states.membership.gpid, ""); dassert (proposal.config.app_type == _primary_states.membership.app_type, ""); dassert (proposal.config.primary == _primary_states.membership.primary, ""); diff --git a/src/apps/replication/lib/replica_stub.cpp b/src/apps/replication/lib/replica_stub.cpp index d26ca3a847..5070f97361 100644 --- a/src/apps/replication/lib/replica_stub.cpp +++ b/src/apps/replication/lib/replica_stub.cpp @@ -138,15 +138,7 @@ void replica_stub::initialize(const replication_options& opts, configuration_ptr it->second->get_ballot() ); - if (err != ERR_SUCCESS) - { - // prevent them to be primary, secondary, etc. - it->second->update_local_configuration_with_no_ballot_change(PS_ERROR); - } - else - { - it->second->set_inactive_state_transient(true); - } + it->second->set_inactive_state_transient(err == ERR_SUCCESS); } // start log serving