}
-void Paxos::finish_proposal()
+void Paxos::finish_queued_proposal()
{
- /* There is a lot of debug still going around. We will get rid of it later
- * on, as soon as everything "just works (tm)"
- */
assert(mon->is_leader());
+ assert(!proposals.empty());
dout(10) << __func__ << " finishing proposal" << dendl;
C_Proposal *proposal = static_cast<C_Proposal*>(proposals.front());
dout(10) << __func__ << " finish it (proposal = "
<< proposal << ")" << dendl;;
- if (!proposal) // this is okay. It happens when we propose an old value.
- return;
+ assert(proposal != NULL);
if (!proposal->proposed) {
dout(10) << __func__ << " we must have received a stay message and we're "
proposals.pop_front();
proposal->finish(0);
}
+}
+
+void Paxos::finish_proposal()
+{
+ /* There is a lot of debug still going around. We will get rid of it later
+ * on, as soon as everything "just works (tm)"
+ */
+ assert(mon->is_leader());
+ if (!proposals.empty())
+ finish_queued_proposal();
dout(10) << __func__ << " state " << state
<< " proposals left " << proposals.size() << dendl;