<< accepted_pn << " last_committed: " << last_committed
<< " first_committed: " << first_committed << dendl;
- //slurping = get_store()->get(get_name(), "slurping");
-
dout(10) << "init" << dendl;
}
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);
}
* last committed version, which will then be kept in this map.
*/
map<int,version_t> peer_last_committed;
- /**
- * @todo Check out what 'slurping' is.
- */
- int slurping;
/**
* @}
*/
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),
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