while (paxosv > client_map.version) {
bufferlist bl;
bool success = paxos->read(client_map.version+1, bl);
- if (success) {
- dout(7) << "update_from_paxos applying incremental " << client_map.version+1 << dendl;
- Incremental inc;
- bufferlist::iterator p = bl.begin();
- inc.decode(p);
- client_map.apply_incremental(inc);
-
- dout(1) << client_map.client_addr.size() << " clients (+"
- << inc.mount.size() << " -" << inc.unmount.size() << ")"
- << dendl;
-
- } else {
- dout(7) << "update_from_paxos couldn't read incremental " << client_map.version+1 << dendl;
- return false;
- }
+ assert(success);
+
+ dout(7) << "update_from_paxos applying incremental " << client_map.version+1 << dendl;
+ Incremental inc;
+ bufferlist::iterator p = bl.begin();
+ inc.decode(p);
+ client_map.apply_incremental(inc);
+
+ dout(1) << client_map.client_addr.size() << " clients (+"
+ << inc.mount.size() << " -" << inc.unmount.size() << ")"
+ << dendl;
}
// save latest
while (paxosv > pg_map.version) {
bufferlist bl;
bool success = paxos->read(pg_map.version+1, bl);
- if (success) {
- dout(7) << "update_from_paxos applying incremental " << pg_map.version+1 << dendl;
- PGMap::Incremental inc;
- bufferlist::iterator p = bl.begin();
- inc.decode(p);
- pg_map.apply_incremental(inc);
-
- dout(0) << *this << dendl;
- } else {
- dout(7) << "update_from_paxos couldn't read incremental " << pg_map.version+1 << dendl;
- return false;
- }
+ assert(success);
+
+ dout(7) << "update_from_paxos applying incremental " << pg_map.version+1 << dendl;
+ PGMap::Incremental inc;
+ bufferlist::iterator p = bl.begin();
+ inc.decode(p);
+ pg_map.apply_incremental(inc);
+
+ dout(0) << *this << dendl;
}
// save latest
bool Paxos::read(version_t v, bufferlist &bl)
{
- if (!is_readable())
- return false;
-
if (!mon->store->get_bl_sn(bl, machine_name, v))
return false;
return true;
version_t Paxos::read_current(bufferlist &bl)
{
- if (!is_readable())
- return 0;
if (read(last_committed, bl))
return last_committed;
return 0;