In bug #5424 I observed leveldb failing internally and then returning
bad info. We then hit a random/confusing assert. Try to detect this
earlier by verifying that a get of a just-written last_committed gives
us back the right thing.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
get_store()->apply_transaction(t);
+ _sanity_check_store();
}
if (get_store()->exists(get_name(), "conversion_first")) {
}
+void Paxos::_sanity_check_store()
+{
+ version_t lc = get_store()->get(get_name(), "last_committed");
+ assert(lc == last_committed);
+}
+
+
// leader
void Paxos::handle_last(MMonPaxos *last)
{
get_store()->apply_transaction(t);
+ _sanity_check_store();
+
// tell everyone
for (set<int>::const_iterator p = mon->get_quorum().begin();
p != mon->get_quorum().end();
* @param m A message
*/
void store_state(MMonPaxos *m);
+ void _sanity_check_store();
/**
* Helper function to decode a bufferlist into a transaction and append it
* to another transaction.