From 431443e005cc42c7f4fd77d160326218ce3aefc4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 3 Dec 2008 13:41:12 -0800 Subject: [PATCH] mon: always discard pending on election completion Previously we tried to save the pending if we were still the leader. The problem is that while we were not leader, we may have missed out on some updates, in which case the pending may no longer be based on the current state. In the future, we could make the commit waiters smart about callback return codes so that they try to reapply. For now, don't worry about it. --- src/mon/PaxosService.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index 846942d24a88e..8e95dfb92d600 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -153,8 +153,7 @@ void PaxosService::election_finished() { dout(10) << "election_finished" << dendl; - if (have_pending && - !mon->is_leader()) { + if (have_pending) { discard_pending(); have_pending = false; } -- 2.39.5