]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
paxos: fix off-by-one in share_state
authorSage Weil <sage@newdream.net>
Fri, 11 Nov 2011 20:15:16 +0000 (12:15 -0800)
committerSage Weil <sage@newdream.net>
Fri, 11 Nov 2011 20:15:16 +0000 (12:15 -0800)
We hit this on adding a new monitor to an existing cluster.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/Paxos.cc

index 800b30b52c588906985cebfefb3042ba47d76036..bf1fd3bd68ff8d00dfcaac99248becae42d86dcd 100644 (file)
@@ -159,7 +159,7 @@ void Paxos::share_state(MMonPaxos *m, version_t peer_first_committed, version_t
   version_t v = peer_last_committed;
 
   // start with a stashed full copy?
-  if (peer_last_committed < first_committed) {
+  if (peer_last_committed + 1 < first_committed) {
     bufferlist bl;
     version_t l = get_latest(bl);
     assert(l <= last_committed);