Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon: remove the redundant is_active judge in PaxosService #9749

Merged
merged 1 commit into from Jul 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/mon/PaxosService.cc
Expand Up @@ -254,7 +254,7 @@ void PaxosService::_active()
dout(10) << "_active" << dendl;

// create pending state?
if (mon->is_leader() && is_active()) {
if (mon->is_leader()) {
dout(7) << "_active creating new pending" << dendl;
if (!have_pending) {
create_pending();
Expand All @@ -270,8 +270,6 @@ void PaxosService::_active()
} else {
if (!mon->is_leader()) {
dout(7) << __func__ << " we are not the leader, hence we propose nothing!" << dendl;
} else if (!is_active()) {
dout(7) << __func__ << " we are not active, hence we propose nothing!" << dendl;
}
}

Expand All @@ -280,13 +278,12 @@ void PaxosService::_active()
// on this list; it is on Paxos's.
finish_contexts(g_ceph_context, waiting_for_finished_proposal, 0);

if (is_active() && mon->is_leader())
if (mon->is_leader())
upgrade_format();

// NOTE: it's possible that this will get called twice if we commit
// an old paxos value. Implementations should be mindful of that.
if (is_active())
on_active();
on_active();
}


Expand Down