From 17aa2d6d16c77028bae1d2a77903cdfd81efa096 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 25 Jul 2013 11:10:53 -0700 Subject: [PATCH] mon/Paxos: share uncommitted value when leader is/was behind If the leader has and older lc than we do, and we are sharing states to bring them up to date, we still want to also share our uncommitted value. This particular case was broken by b26b7f6e, which was only contemplating the case where the leader was ahead of us or at the same point as us, but not the case where the leader was behind. Note that the call to share_state() a few lines up will bring them fully up to date, so after they receive and store_state() for this message they will be at the same lc as we are. Fixes: #5750 Backport: cuttlefish Signed-off-by: Sage Weil Reviewed-by: Greg Farnum Reviewed-by: Joao Eduardo Luis (cherry picked from commit 05b6c7e8645081f405c616735238ae89602d3cc6) --- src/mon/Paxos.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index 4cf7b700242bc..a6f9c3058d9ab 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -217,7 +217,7 @@ void Paxos::handle_collect(MMonPaxos *collect) // do we have an accepted but uncommitted value? // (it'll be at last_committed+1) bufferlist bl; - if (collect->last_committed == last_committed && + if (collect->last_committed <= last_committed && get_store()->exists(get_name(), last_committed+1)) { get_store()->get(get_name(), last_committed+1, bl); assert(bl.length() > 0); -- 2.39.5