summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Eduardo Luis <joao.luis@inktank.com>2013-04-29 21:58:28 +0100
committerJoao Eduardo Luis <joao.luis@inktank.com>2013-04-29 21:58:28 +0100
commit058c6993e70a1a366a3ee8b262c8e90b5d1a3d83 (patch)
treeb61a113542fa28cc241818edfd69e7dfdffe7d86
parent0c82d55a803608ab07ef30e832ea94a62ecd3475 (diff)
downloadceph-058c6993e70a1a366a3ee8b262c8e90b5d1a3d83.tar.gz
mon: Paxos: debug proposals
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r--src/mon/Paxos.cc19
-rw-r--r--src/mon/Paxos.h8
2 files changed, 16 insertions, 11 deletions
diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc
index 46eaf88273d..f40b7e3f165 100644
--- a/src/mon/Paxos.cc
+++ b/src/mon/Paxos.cc
@@ -1237,15 +1237,20 @@ bool Paxos::is_writeable()
is_lease_valid();
}
-void Paxos::list_proposals(ostream& out)
+void Paxos::debug_proposals(ostream& out)
{
- out << __func__ << " " << proposals.size() << " in queue:\n";
+ if (proposals.empty())
+ return;
+
+ size_t n = 0;
list<Context*>::iterator p_it = proposals.begin();
- for (int i = 0; p_it != proposals.end(); ++p_it, ++i) {
+ out << __func__ << "\n";
+ for ( ; p_it != proposals.end(); ++p_it, ++n) {
C_Proposal *p = (C_Proposal*) *p_it;
- out << "-- entry #" << i << "\n";
- out << *p << "\n";
+ out << __func__ << "queued-on: " << p->proposal_time
+ << " size: " << p->bl.length() << "\n";
}
+ out << __func__ << " " << n << " queued proposals\n";
}
void Paxos::propose_queued()
@@ -1263,8 +1268,8 @@ void Paxos::propose_queued()
<< " " << proposal->bl.length() << " bytes" << dendl;
proposal->proposed = true;
- dout(30) << __func__ << " ";
- list_proposals(*_dout);
+ dout(20) << __func__ << " ";
+ debug_proposals(*_dout);
*_dout << dendl;
begin(proposal->bl);
diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h
index ca467ce3db8..d674bce8369 100644
--- a/src/mon/Paxos.h
+++ b/src/mon/Paxos.h
@@ -1296,12 +1296,12 @@ public:
}
/**
- * List all queued proposals
+ * Output debug info on all queued proposals
*
- * @param out[out] Output Stream onto which we will output the list
- * of queued proposals.
+ * @param out[out] Output Stream onto which we will output the debug info
+ * for queued proposals.
*/
- void list_proposals(ostream& out);
+ void debug_proposals(ostream& out);
/**
* Propose a new value to the Leader.
*