summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-21 08:12:46 -0700
committerSage Weil <sage@inktank.com>2013-07-22 14:13:24 -0700
commit19b29788966eb80ed847630090a16a3d1b810969 (patch)
tree1fa2c819cd5e3795d0f9127fa6a0338d98d3d71b
parentb3253a453c057914753846c77499f98d3845c58e (diff)
downloadceph-19b29788966eb80ed847630090a16a3d1b810969.tar.gz
mon/Paxos: debug ignored uncommitted values
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/mon/Paxos.cc28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc
index 7e39fce37e3..bf9bb52c05c 100644
--- a/src/mon/Paxos.cc
+++ b/src/mon/Paxos.cc
@@ -391,17 +391,23 @@ void Paxos::handle_last(MMonPaxos *last)
<< num_last << " peons" << dendl;
// did this person send back an accepted but uncommitted value?
- if (last->uncommitted_pn &&
- last->uncommitted_pn > uncommitted_pn &&
- last->last_committed >= last_committed &&
- last->last_committed + 1 >= uncommitted_v) {
- uncommitted_v = last->last_committed+1;
- uncommitted_pn = last->uncommitted_pn;
- uncommitted_value = last->values[uncommitted_v];
- dout(10) << "we learned an uncommitted value for " << uncommitted_v
- << " pn " << uncommitted_pn
- << " " << uncommitted_value.length() << " bytes"
- << dendl;
+ if (last->uncommitted_pn) {
+ if (last->uncommitted_pn > uncommitted_pn &&
+ last->last_committed >= last_committed &&
+ last->last_committed + 1 >= uncommitted_v) {
+ uncommitted_v = last->last_committed+1;
+ uncommitted_pn = last->uncommitted_pn;
+ uncommitted_value = last->values[uncommitted_v];
+ dout(10) << "we learned an uncommitted value for " << uncommitted_v
+ << " pn " << uncommitted_pn
+ << " " << uncommitted_value.length() << " bytes"
+ << dendl;
+ } else {
+ dout(10) << "ignoring uncommitted value for " << (last->last_committed+1)
+ << " pn " << last->uncommitted_pn
+ << " " << last->values[last->last_committed+1].length() << " bytes"
+ << dendl;
+ }
}
// is that everyone?