summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-04-30 21:16:16 -0700
committerSage Weil <sage@inktank.com>2013-05-01 10:57:47 -0700
commit3a6138b25ed38d7e55c85b997fb8533e97e63c68 (patch)
tree6b16cb44f2a7d02b32136ef9754ff93ae056dfac
parent8a8ae159f5bf3dd663b7524b41b5bad276a4f6de (diff)
downloadceph-3a6138b25ed38d7e55c85b997fb8533e97e63c68.tar.gz
mon/Paxos: don't ignore peer first_committed
We go to the effort of keeping a map of the peer's first/last committed so that we can send the right commits during the first phase of paxos, but we forgot to record the first value. This appears to simply be an oversight. It is mostly harmless; it just means we send extra states that the peer already has. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com>
-rw-r--r--src/mon/Paxos.cc5
-rw-r--r--src/mon/Paxos.h7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc
index f306a8bf296..d57562a0f63 100644
--- a/src/mon/Paxos.cc
+++ b/src/mon/Paxos.cc
@@ -362,8 +362,9 @@ void Paxos::handle_last(MMonPaxos *last)
return;
}
- // note peer's last_committed, in case we learn a new commit and need to
- // push it to them.
+ // note peer's first_ and last_committed, in case we learn a new
+ // commit and need to push it to them.
+ peer_first_committed[last->get_source().num()] = last->first_committed;
peer_last_committed[last->get_source().num()] = last->last_committed;
if (last->first_committed > last_committed+1) {
diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h
index ca467ce3db8..2e1bb62dda9 100644
--- a/src/mon/Paxos.h
+++ b/src/mon/Paxos.h
@@ -300,8 +300,11 @@ private:
*/
version_t accepted_pn_from;
/**
- * @todo Check out if this map has any purpose at all. So far, we have only
- * seen it being read, although it is never affected.
+ * Map holding the first committed version by each quorum member.
+ *
+ * The versions kept in this map are updated during the collect phase.
+ * When the Leader starts the collect phase, each Peon will reply with its
+ * first committed version, which will then be kept in this map.
*/
map<int,version_t> peer_first_committed;
/**