ObjectStore::Transaction t;
t.create_collection(0);
t.write(0, OSD_SUPERBLOCK_POBJECT, 0, bl.length(), bl);
- store->apply_transaction(t);
-
+ int r = store->apply_transaction(t);
store->umount();
delete store;
- return 0;
+ return r;
}
int OSD::peek_super(const char *dev, nstring& magic, ceph_fsid_t& fsid, int& whoami)
superblock.clean_thru = osdmap->get_epoch();
ObjectStore::Transaction t;
write_superblock(t);
- store->apply_transaction(t);
+ int r = store->apply_transaction(t);
+ if (r) {
+ char buf[80];
+ dout(0) << "error writing superblock " << r << " " << strerror_r(-r, buf, sizeof(buf)) << dendl;
+ }
// flush data to disk
osd_lock.Unlock();
dout(10) << "sync" << dendl;
store->sync();
- int r = store->umount();
+ r = store->umount();
delete store;
store = 0;
dout(10) << "sync done" << dendl;
dout(10) << "handle_osd_map got full map epoch " << p->first << dendl;
ObjectStore::Transaction ft;
ft.write(0, poid, 0, p->second.length(), p->second); // store _outside_ transaction; activate_map reads it.
- store->apply_transaction(ft);
+ int r = store->apply_transaction(ft);
+ if (r) {
+ char buf[80];
+ dout(0) << "error writing map: " << r << " " << strerror_r(-r, buf, sizeof(buf)) << dendl;
+ shutdown();
+ return;
+ }
if (p->first > superblock.newest_map)
superblock.newest_map = p->first;
dout(10) << "handle_osd_map got incremental map epoch " << p->first << dendl;
ObjectStore::Transaction ft;
ft.write(0, poid, 0, p->second.length(), p->second); // store _outside_ transaction; activate_map reads it.
- store->apply_transaction(ft);
+ int r = store->apply_transaction(ft);
+ if (r) {
+ char buf[80];
+ dout(0) << "error writing map: " << r << " " << strerror_r(-r, buf, sizeof(buf)) << dendl;
+ shutdown();
+ return;
+ }
if (p->first > superblock.newest_map)
superblock.newest_map = p->first;
osdmap->encode(bl);
ObjectStore::Transaction ft;
ft.write(0, get_osdmap_pobject_name(cur+1), 0, bl.length(), bl);
- store->apply_transaction(ft);
+ int r = store->apply_transaction(ft);
+ if (r) {
+ char buf[80];
+ dout(0) << "error writing map: " << r << " " << strerror_r(-r, buf, sizeof(buf)) << dendl;
+ shutdown();
+ return;
+ }
// notify messenger
for (map<int32_t,uint8_t>::iterator i = inc.new_down.begin();
// superblock and commit
write_superblock(t);
- store->apply_transaction(t);
+ int r = store->apply_transaction(t);
+ if (r) {
+ char buf[80];
+ dout(0) << "error writing map: " << r << " " << strerror_r(-r, buf, sizeof(buf)) << dendl;
+ shutdown();
+ return;
+ }
store->sync();
map_lock.put_write();
pg->unlock();
created++;
}
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
// remove from queue
pg_split_ready.erase(p);
}
}
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
for (vector<PG*>::iterator p = to_peer.begin(); p != to_peer.end(); p++) {
PG *pg = *p;
pg->unlock();
}
- unsigned tr = store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
assert(tr == 0);
do_queries(query_map);
pg->info.history = info.history;
pg->write_info(t);
pg->write_log(t);
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
created++;
} else {
pg = _lookup_lock_pg(info.pgid);
}
}
- unsigned tr = store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
assert(tr == 0);
pg->unlock();
ObjectStore::Transaction t;
pg->trim(t, m->trim_to);
pg->write_info(t);
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
}
pg->unlock();
}
pg->info.history = history;
pg->write_info(t);
pg->write_log(t);
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
created++;
dout(10) << *pg << " dne (before), but i am role " << role << dendl;
ObjectStore::Transaction t;
pg->write_info(t);
t.remove(0, pg->log_oid);
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
}
int n = 0;
ObjectStore::Transaction t;
t.remove(coll_t::build_snap_pg_coll(pgid, *p), *q);
t.remove(coll_t::build_pg_coll(pgid), *q); // we may hit this twice, but it's harmless
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
if ((++n & 0xff) == 0) {
pg->unlock();
}
ObjectStore::Transaction t;
t.remove_collection(coll_t::build_snap_pg_coll(pgid, *p));
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
}
// (what remains of the) main collection
p++) {
ObjectStore::Transaction t;
t.remove(coll_t::build_pg_coll(pgid), *p);
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
if ((++n & 0xff) == 0) {
pg->unlock();
{
ObjectStore::Transaction t;
t.remove_collection(coll_t::build_pg_coll(pgid));
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
}
// remove from map
pg->write_info(t);
if (pg->dirty_log)
pg->write_log(t);
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
}
out2:
pg->replay_until == activate_at) {
ObjectStore::Transaction t;
pg->activate(t);
- store->apply_transaction(t);
+ int tr = store->apply_transaction(t);
+ assert(tr == 0);
}
pg->unlock();
}
t.setattr(coll_t::build_pg_coll(info.pgid), snapoid, SS_ATTR, bl);
}
- osd->store->apply_transaction(t);
+ int tr = osd->store->apply_transaction(t);
+ assert(tr == 0);
// give other threads a chance at this pg
unlock();
snap_collections.erase(sn);
write_info(t);
t.remove_collection(c);
- osd->store->apply_transaction(t);
+ int tr = osd->store->apply_transaction(t);
+ assert(tr == 0);
info.snap_trimq.erase(sn);
}
ObjectStore::Transaction t;
write_info(t);
- osd->store->apply_transaction(t);
+ int tr = osd->store->apply_transaction(t);
+ assert(tr == 0);
unlock();
return true;
}
list<ObjectStore::Transaction*> tls;
tls.push_back(&repop->ctx->op_t);
tls.push_back(&repop->ctx->local_t);
- unsigned r = osd->store->apply_transactions(tls, oncommit);
- if (r)
+ int r = osd->store->apply_transactions(tls, oncommit);
+ if (r) {
dout(-10) << "apply_repop apply transaction return " << r << " on " << *repop << dendl;
+ assert(0);
+ }
// discard my reference to the buffer
repop->ctx->op->get_data().clear();
C_OSD_RepModifyCommit *oncommit = new C_OSD_RepModifyCommit(this, op, ackerosd,
info.last_complete);
- unsigned r = osd->store->apply_transactions(tls, oncommit);
+ int r = osd->store->apply_transactions(tls, oncommit);
if (r) {
derr(0) << "error applying transaction: r = " << r << dendl;
+ assert(0);
}
// ack myself.
// apply to disk!
write_info(t);
- unsigned r = osd->store->apply_transaction(t, new C_OSD_Commit(this, info.history.same_acting_since,
+ int r = osd->store->apply_transaction(t, new C_OSD_Commit(this, info.history.same_acting_since,
info.last_complete));
assert(r == 0);
put_object_context(headobc);
- osd->store->apply_transaction(t);
+ int tr = osd->store->apply_transaction(t);
+ assert(tr == 0);
missing.got(latest->soid, latest->version);
missing_loc.erase(latest->soid);
continue;