]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: don't ignore peer first_committed
authorSage Weil <sage@inktank.com>
Wed, 1 May 2013 04:16:16 +0000 (21:16 -0700)
committerSage Weil <sage@inktank.com>
Wed, 1 May 2013 17:57:47 +0000 (10:57 -0700)
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>
src/mon/Paxos.cc
src/mon/Paxos.h

index f306a8bf296f3d1f743a357f34ba945aa3b27482..d57562a0f6303edf8f8c34d28d4b494b50a11f90 100644 (file)
@@ -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) {
index ca467ce3db8711a487cd38940128f123976b76e8..2e1bb62dda9c5d41aa0058f8add29d0fc262ce40 100644 (file)
@@ -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;
   /**