From b33d4eacaadd84eb765df55772dc9d11cbc6e36e Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Fri, 31 Aug 2012 18:39:27 +0100 Subject: [PATCH] mon: Paxos: get rid of slurp-related code Signed-off-by: Joao Eduardo Luis --- src/mon/Paxos.cc | 32 +------------------------------- src/mon/Paxos.h | 17 ----------------- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index e964c128bccfb..add582ea263c5 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -61,8 +61,6 @@ void Paxos::init() << accepted_pn << " last_committed: " << last_committed << " first_committed: " << first_committed << dendl; - //slurping = get_store()->get(get_name(), "slurping"); - dout(10) << "init" << dendl; } @@ -1216,34 +1214,6 @@ bool Paxos::propose_new_value(bufferlist& bl, Context *onfinished) bool Paxos::is_consistent() { - bool consistent = true; - if (first_committed > last_committed) - consistent = false; - if (slurping != 0) - consistent = false; - - if (!(consistent || (slurping == 1))) { - dout(5) << "consistent: " << consistent - << " slurping: " << slurping << dendl; - } - assert(consistent || (slurping == 1)); - return consistent; -} - -void Paxos::start_slurping() -{ - if (slurping != 1) { - slurping = 1; -// get_store()->put(get_name(), "slurping", 1); - } -} - -void Paxos::end_slurping() -{ - if (slurping == 1) { - slurping = 0; - // get_store()->put(get_name(), "slurping", slurping); - } - assert(is_consistent()); + return (first_committed <= last_committed); } diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index a2be3907836ee..ca1304365f0ff 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -312,10 +312,6 @@ private: * last committed version, which will then be kept in this map. */ map peer_last_committed; - /** - * @todo Check out what 'slurping' is. - */ - int slurping; /** * @} */ @@ -1007,7 +1003,6 @@ public: last_committed(0), accepted_pn(0), accepted_pn_from(0), - slurping(0), num_last(0), uncommitted_v(0), uncommitted_pn(0), collect_timeout_event(0), @@ -1193,18 +1188,6 @@ public: return true; } - /** - * @defgroup Paxos_h_slurping_funcs Slurping-related functions - * @todo Discover what slurping is - * @{ - */ - void start_slurping(); - void end_slurping(); - bool is_slurping() { return slurping == 1; } - /** - * @} - */ - // read /** * @defgroup Paxos_h_read_funcs Read-related functions -- 2.39.5