}
if (!t.empty()) {
- fs->store->queue_transaction(ch, std::move(t), nullptr);
+ fs->store->queue_transaction(ch, std::move(t));
}
return 0;
}
if (!t.empty()) {
- fs->store->queue_transaction(ch, std::move(t), nullptr);
+ fs->store->queue_transaction(ch, std::move(t));
}
if (pbl) {
return 0;
}
- fs->store->queue_transaction(ch, std::move(t), nullptr);
+ fs->store->queue_transaction(ch, std::move(t));
return 0;
}
return -EPERM;
}
- fs->store->queue_transaction(ch, std::move(t), nullptr);
+ fs->store->queue_transaction(ch, std::move(t));
return 0;
}
ObjectStore::CollectionHandle ch = fs->store->open_collection(cid);
ObjectStore::Transaction t;
t.truncate(cid, oid, size);
- fs->store->queue_transaction(ch, std::move(t), nullptr);
+ fs->store->queue_transaction(ch, std::move(t));
return 0;
}
return out << "Transaction(" << &tx << ")";
}
-int ObjectStore::queue_transactions(
- CollectionHandle& ch,
- vector<Transaction>& tls,
- Context *onreadable,
- Context *oncommit,
- Context *onreadable_sync,
- Context *oncomplete,
- TrackedOpRef op = TrackedOpRef())
-{
- RunOnDeleteRef _complete (std::make_shared<RunOnDelete>(oncomplete));
- Context *_onreadable = new Wrapper<RunOnDeleteRef>(
- onreadable, _complete);
- Context *_oncommit = new Wrapper<RunOnDeleteRef>(
- oncommit, _complete);
- return queue_transactions(ch, tls, _onreadable, _oncommit,
- onreadable_sync, op);
-}
static void generate_test_instances(list<Transaction*>& o);
};
- int queue_transaction(CollectionHandle& ch, Transaction&& t, Context *onreadable, Context *ondisk=0,
- Context *onreadable_sync=0,
- TrackedOpRef op = TrackedOpRef(),
- ThreadPool::TPHandle *handle = NULL) {
+ int queue_transaction(CollectionHandle& ch,
+ Transaction&& t,
+ TrackedOpRef op = TrackedOpRef(),
+ ThreadPool::TPHandle *handle = NULL) {
vector<Transaction> tls;
tls.push_back(std::move(t));
- return queue_transactions(ch, tls, onreadable, ondisk, onreadable_sync,
- op, handle);
- }
-
- int queue_transactions(CollectionHandle& ch, vector<Transaction>& tls,
- Context *onreadable, Context *ondisk=0,
- Context *onreadable_sync=0,
- TrackedOpRef op = TrackedOpRef(),
- ThreadPool::TPHandle *handle = NULL) {
- assert(!tls.empty());
- tls.back().register_on_applied(onreadable);
- tls.back().register_on_commit(ondisk);
- tls.back().register_on_applied_sync(onreadable_sync);
return queue_transactions(ch, tls, op, handle);
}
ThreadPool::TPHandle *handle = NULL) = 0;
- int queue_transactions(
- CollectionHandle& ch,
- vector<Transaction>& tls,
- Context *onreadable,
- Context *oncommit,
- Context *onreadable_sync,
- Context *oncomplete,
- TrackedOpRef op);
-
- int queue_transaction(
- CollectionHandle& ch,
- Transaction&& t,
- Context *onreadable,
- Context *oncommit,
- Context *onreadable_sync,
- Context *oncomplete,
- TrackedOpRef op) {
-
- vector<Transaction> tls;
- tls.push_back(std::move(t));
- return queue_transactions(
- ch, tls, onreadable, oncommit, onreadable_sync, oncomplete, op);
- }
-
public:
ObjectStore(CephContext* cct,
const std::string& path_) : path(path_), cct(cct) {}
ObjectStore::Transaction t;
t.create_collection(coll_t::meta(), 0);
t.write(coll_t::meta(), OSD_SUPERBLOCK_GOBJECT, 0, bl.length(), bl);
- ret = store->queue_transaction(ch, std::move(t), nullptr);
+ ret = store->queue_transaction(ch, std::move(t));
if (ret) {
derr << "OSD::mkfs: error while writing OSD_SUPERBLOCK_GOBJECT: "
<< "queue_transaction returned " << cpp_strerror(ret) << dendl;
dout(5) << "Upgrading superblock adding: " << diff << dendl;
ObjectStore::Transaction t;
write_superblock(t);
- r = store->queue_transaction(service.meta_ch, std::move(t), nullptr);
+ r = store->queue_transaction(service.meta_ch, std::move(t));
if (r < 0)
goto out;
}
dout(10) << "init creating/touching snapmapper object" << dendl;
ObjectStore::Transaction t;
t.touch(coll_t::meta(), OSD::make_snapmapper_oid());
- r = store->queue_transaction(service.meta_ch, std::move(t), nullptr);
+ r = store->queue_transaction(service.meta_ch, std::move(t));
if (r < 0)
goto out;
}
superblock.clean_thru = osdmap->get_epoch();
ObjectStore::Transaction t;
write_superblock(t);
- int r = store->queue_transaction(service.meta_ch, std::move(t), nullptr);
+ int r = store->queue_transaction(service.meta_ch, std::move(t));
if (r) {
derr << "OSD::shutdown: error writing superblock: "
<< cpp_strerror(r) << dendl;
dout(20) << " removing " << *p << " object " << *q << dendl;
t.remove(*p, *q);
if (++removed > cct->_conf->osd_target_transaction_size) {
- store->queue_transaction(service.meta_ch, std::move(t), nullptr);
+ store->queue_transaction(service.meta_ch, std::move(t));
t = ObjectStore::Transaction();
removed = 0;
}
}
if (removed) {
- store->queue_transaction(service.meta_ch, std::move(t), nullptr);
+ store->queue_transaction(service.meta_ch, std::move(t));
}
}
}
ceph_abort();
t.remove(tmp, *p);
if (removed > cct->_conf->osd_target_transaction_size) {
- int r = store->queue_transaction(ch, std::move(t), nullptr);
+ int r = store->queue_transaction(ch, std::move(t));
assert(r == 0);
t = ObjectStore::Transaction();
removed = 0;
}
}
t.remove_collection(tmp);
- int r = store->queue_transaction(ch, std::move(t), nullptr);
+ int r = store->queue_transaction(ch, std::move(t));
assert(r == 0);
C_SaferCond waiter;
val.append(valstr);
newattrs[key] = val;
t.omap_setkeys(coll_t(pgid), ghobject_t(obj), newattrs);
- r = store->queue_transaction(service->meta_ch, std::move(t), nullptr);
+ r = store->queue_transaction(service->meta_ch, std::move(t));
if (r < 0)
ss << "error=" << r;
else
keys.insert(key);
t.omap_rmkeys(coll_t(pgid), ghobject_t(obj), keys);
- r = store->queue_transaction(service->meta_ch, std::move(t), nullptr);
+ r = store->queue_transaction(service->meta_ch, std::move(t));
if (r < 0)
ss << "error=" << r;
else
cmd_getval(service->cct, cmdmap, "header", headerstr);
newheader.append(headerstr);
t.omap_setheader(coll_t(pgid), ghobject_t(obj), newheader);
- r = store->queue_transaction(service->meta_ch, std::move(t), nullptr);
+ r = store->queue_transaction(service->meta_ch, std::move(t));
if (r < 0)
ss << "error=" << r;
else
int64_t trunclen;
cmd_getval(service->cct, cmdmap, "len", trunclen);
t.truncate(coll_t(pgid), ghobject_t(obj), trunclen);
- r = store->queue_transaction(service->meta_ch, std::move(t), nullptr);
+ r = store->queue_transaction(service->meta_ch, std::move(t));
if (r < 0)
ss << "error=" << r;
else
// superblock and commit
write_superblock(t);
+ t.register_on_applied(new C_OnMapApply(&service, std::move(pinned_maps), last));
+ t.register_on_commit(new C_OnMapCommit(this, start, last, m));
store->queue_transaction(
service.meta_ch,
- std::move(t),
- new C_OnMapApply(&service, std::move(pinned_maps), last),
- new C_OnMapCommit(this, start, last, m), 0);
+ std::move(t));
service.publish_superblock(superblock);
}
ThreadPool::TPHandle *handle)
{
if (!ctx.transaction->empty()) {
+ if (ctx.on_applied)
+ ctx.transaction->register_on_applied(ctx.on_applied);
+ if (ctx.on_safe)
+ ctx.transaction->register_on_commit(ctx.on_safe);
int tr = store->queue_transaction(
pg->ch,
- std::move(*ctx.transaction), ctx.on_applied, ctx.on_safe, NULL,
- TrackedOpRef(), handle);
+ std::move(*ctx.transaction), TrackedOpRef(), handle);
assert(tr == 0);
delete (ctx.transaction);
for (auto pg : ctx.created_pgs) {
delete ctx.on_safe;
assert(ctx.created_pgs.empty());
} else {
+ if (ctx.on_applied)
+ ctx.transaction->register_on_applied(ctx.on_applied);
+ if (ctx.on_safe)
+ ctx.transaction->register_on_commit(ctx.on_safe);
int tr = store->queue_transaction(
pg->ch,
- std::move(*ctx.transaction), ctx.on_applied, ctx.on_safe, NULL, TrackedOpRef(),
+ std::move(*ctx.transaction), TrackedOpRef(),
handle);
for (auto pg : ctx.created_pgs) {
pg->ch = store->open_collection(pg->coll);
write_if_dirty(t);
ObjectStore::CollectionHandle ch = store->open_collection(coll);
- int r = store->queue_transaction(ch, std::move(t), nullptr);
+ int r = store->queue_transaction(ch, std::move(t));
if (r != 0) {
derr << __func__ << ": queue_transaction returned "
<< cpp_strerror(r) << dendl;
PG::RecoveryCtx rctx(0, 0, 0, 0, 0, new ObjectStore::Transaction);
handle_loaded(&rctx);
write_if_dirty(*rctx.transaction);
- store->queue_transaction(ch, std::move(*rctx.transaction), nullptr);
+ store->queue_transaction(ch, std::move(*rctx.transaction));
delete rctx.transaction;
}
<< "...repaired";
}
snap_mapper.add_oid(hoid, obj_snaps, &_t);
- r = osd->store->queue_transaction(ch, std::move(t), nullptr);
+ r = osd->store->queue_transaction(ch, std::move(t));
if (r != 0) {
derr << __func__ << ": queue_transaction got " << cpp_strerror(r)
<< dendl;
o.attrs[OI_ATTR] = bp;
t.setattr(coll, ghobject_t(hoid), OI_ATTR, bl);
- int r = osd->store->queue_transaction(ch, std::move(t), nullptr);
+ int r = osd->store->queue_transaction(ch, std::move(t));
if (r != 0) {
derr << __func__ << ": queue_transaction got " << cpp_strerror(r)
<< dendl;
lderr(cct) << __func__ << " setting bit width to " << bits << dendl;
ObjectStore::Transaction t;
t.collection_set_bits(coll, bits);
- osd->store->queue_transaction(ch, std::move(t), nullptr);
+ osd->store->queue_transaction(ch, std::move(t));
}
}
}
if (num) {
dout(20) << __func__ << " deleting " << num << " objects" << dendl;
Context *fin = new C_DeleteMore(this, e);
+ t.register_on_applied(fin);
+ t.register_on_commit(fin);
osd->store->queue_transaction(
ch,
- std::move(t),
- fin,
- fin);
+ std::move(t));
} else {
dout(20) << __func__ << " finished" << dendl;
if (cct->_conf->osd_inject_failure_on_pg_removal) {
PGLog::clear_info_log(info.pgid, &t);
t.remove_collection(coll);
PGRef pgref(this);
+ // keep pg ref around until txn completes to avoid any issues
+ // with Sequencer lifecycle (seen w/ filestore).
+ t.register_on_applied(new ContainerContext<PGRef>(pgref));
+ t.register_on_commit(new ContainerContext<PGRef>(pgref));
+ t.register_on_applied(new ContainerContext<PGRef>(pgref));
int r = osd->store->queue_transaction(
- osd->meta_ch, std::move(t),
- // keep pg ref around until txn completes to avoid any issues
- // with Sequencer lifecycle (seen w/ filestore).
- new ContainerContext<PGRef>(pgref),
- new ContainerContext<PGRef>(pgref));
+ osd->meta_ch, std::move(t));
assert(r == 0);
osd->finish_pg_delete(this);
++active_pushes;
- osd->store->queue_transaction(ch, std::move(t),
- new C_OSD_AppliedRecoveredObject(this, obc),
- new C_OSD_CommittedPushedObject(
- this,
- get_osdmap()->get_epoch(),
- info.last_complete),
- new C_OSD_OndiskWriteUnlock(obc));
+ t.register_on_applied_sync(new C_OSD_OndiskWriteUnlock(obc));
+ t.register_on_applied(new C_OSD_AppliedRecoveredObject(this, obc));
+ t.register_on_commit(new C_OSD_CommittedPushedObject(
+ this,
+ get_osdmap()->get_epoch(),
+ info.last_complete));
+ osd->store->queue_transaction(ch, std::move(t));
continue;
}
} else {
}
void queue_transaction(ObjectStore::Transaction&& t,
OpRequestRef op) override {
- osd->store->queue_transaction(ch, std::move(t), 0, 0, 0, op);
+ osd->store->queue_transaction(ch, std::move(t), op);
}
void queue_transactions(vector<ObjectStore::Transaction>& tls,
OpRequestRef op) override {
- osd->store->queue_transactions(ch, tls, 0, 0, 0, op, NULL);
+ osd->store->queue_transactions(ch, tls, op, NULL);
}
epoch_t get_epoch() const override {
return get_osdmap()->get_epoch();
ObjectStore::Transaction t;
auto meta_ch = m_store->create_new_collection(coll_t::meta());
t.create_collection(coll_t::meta(), 0);
- m_store->queue_transaction(meta_ch, std::move(t), nullptr);
+ m_store->queue_transaction(meta_ch, std::move(t));
wait_for_ready();
if (rand() % 2) {
ObjectStore::Transaction t2;
t2.append(t);
- return store->queue_transaction(ch, std::move(t2), nullptr, nullptr);
+ return store->queue_transaction(ch, std::move(t2));
} else {
- return store->queue_transaction(ch, std::move(t), nullptr, nullptr);
+ return store->queue_transaction(ch, std::move(t));
}
}
t.write(cid, a, 9000, 5, bl, 0);
u.write(cid, a, 10, 5, bl, 0);
u.write(cid, a, 7000, 5, bl, 0);
+ t.register_on_commit(&c);
vector<ObjectStore::Transaction> v = {t, u};
- store->queue_transactions(ch, v, nullptr, &c);
+ store->queue_transactions(ch, v);
}
{
ObjectStore::Transaction t, u;
t.write(cid, a, 6000, 5, bl, 0);
u.write(cid, a, 610, 5, bl, 0);
u.write(cid, a, 11000, 5, bl, 0);
+ t.register_on_commit(&d);
vector<ObjectStore::Transaction> v = {t, u};
- store->queue_transactions(ch, v, nullptr, &d);
+ store->queue_transactions(ch, v);
}
c.wait();
d.wait();
ObjectStore::Transaction t;
t.create_collection(cid, 0);
cerr << "Creating collection " << cid << std::endl;
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
unsigned min_alloc = g_conf->bluestore_min_alloc_size;
{
ObjectStore::Transaction t;
t.write(cid, a, 0, bla.length(), bla, 0);
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
{
ObjectStore::Transaction t;
t.write(cid, a, bla.length(), blb.length(), blb, 0);
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
bufferptr bpc(size);
{
ObjectStore::Transaction t;
t.write(cid, a, bla.length() + blb.length(), blc.length(), blc, 0);
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
bufferlist final;
t.remove(cid, a);
t.remove_collection(cid);
cerr << "Cleaning" << std::endl;
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
g_conf->set_val("bluestore_inject_deferred_apply_delay", "0");
ObjectStore::Transaction t;
t.create_collection(cid, 0);
cerr << "Creating collection " << cid << std::endl;
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
unsigned min_alloc = g_conf->bluestore_min_alloc_size;
bt.append("BADBADBADBAD");
ObjectStore::Transaction t;
t.write(cid, a, 0, bt.length(), bt, 0);
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
{
ObjectStore::Transaction t;
t.truncate(cid, a, size);
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
{
ObjectStore::Transaction t;
t.clone(cid, a, b);
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
{
ObjectStore::Transaction t;
t.write(cid, a, min_alloc * 3, blb.length(), blb, 0);
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
bufferlist final;
t.remove(cid, b);
t.remove_collection(cid);
cerr << "Cleaning" << std::endl;
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
ASSERT_EQ(r, 0);
}
}
in_flight_objects.insert(new_obj);
if (!contents.count(new_obj))
contents[new_obj] = Object();
- int status = store->queue_transaction(ch, std::move(t), new C_SyntheticOnReadable(this, new_obj));
+ t.register_on_applied(new C_SyntheticOnReadable(this, new_obj));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
contents[new_obj].attrs = contents[old_obj].attrs;
contents[new_obj].data = contents[old_obj].data;
contents.erase(old_obj);
- int status = store->queue_transaction(
- ch, std::move(t),
- new C_SyntheticOnStash(this, old_obj, new_obj));
+ t.register_on_applied(new C_SyntheticOnStash(this, old_obj, new_obj));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
contents[new_obj].attrs = contents[old_obj].attrs;
contents[new_obj].data = contents[old_obj].data;
- int status = store->queue_transaction(
- ch, std::move(t),
- new C_SyntheticOnClone(this, old_obj, new_obj));
+ t.register_on_applied(new C_SyntheticOnClone(this, old_obj, new_obj));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
value.swap(dstdata);
}
- int status = store->queue_transaction(
- ch, std::move(t), new C_SyntheticOnClone(this, old_obj, new_obj));
+ t.register_on_applied(new C_SyntheticOnClone(this, old_obj, new_obj));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
t.write(cid, new_obj, offset, len, bl);
++in_flight;
in_flight_objects.insert(new_obj);
- int status = store->queue_transaction(
- ch, std::move(t), new C_SyntheticOnReadable(this, new_obj));
+ t.register_on_applied(new C_SyntheticOnReadable(this, new_obj));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
bl.swap(data);
}
- int status = store->queue_transaction(
- ch, std::move(t), new C_SyntheticOnReadable(this, obj));
+ t.register_on_applied(new C_SyntheticOnReadable(this, obj));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
t.zero(cid, new_obj, offset, len);
++in_flight;
in_flight_objects.insert(new_obj);
- int status = store->queue_transaction(
- ch, std::move(t), new C_SyntheticOnReadable(this, new_obj));
+ t.register_on_applied(new C_SyntheticOnReadable(this, new_obj));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
t.setattrs(cid, obj, attrs);
++in_flight;
in_flight_objects.insert(obj);
- int status = store->queue_transaction(
- ch, std::move(t), new C_SyntheticOnReadable(this, obj));
+ t.register_on_applied(new C_SyntheticOnReadable(this, obj));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
contents[obj].attrs.erase(it->first);
++in_flight;
in_flight_objects.insert(obj);
- int status = store->queue_transaction(
- ch, std::move(t), new C_SyntheticOnReadable(this, obj));
+ t.register_on_applied(new C_SyntheticOnReadable(this, obj));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
available_objects.erase(to_remove);
in_flight_objects.insert(to_remove);
contents.erase(to_remove);
- int status = store->queue_transaction(ch, std::move(t), new C_SyntheticOnReadable(this, to_remove));
+ t.register_on_applied(new C_SyntheticOnReadable(this, to_remove));
+ int status = store->queue_transaction(ch, std::move(t));
return status;
}
assert(!store->mount());
ch = store->create_new_collection(coll);
t.create_collection(coll, 0);
- store->queue_transaction(ch, std::move(t), nullptr);
+ store->queue_transaction(ch, std::move(t));
} else {
assert(!store->mount());
ch = store->open_collection(coll);
ObjectStore::Transaction t;
ch = store->create_new_collection(cid);
t.create_collection(cid, 4);
- unsigned r = store->queue_transaction(ch, std::move(t), nullptr);
+ unsigned r = store->queue_transaction(ch, std::move(t));
if (r != 0) {
derr << "failed to create collection with " << cpp_strerror(r) << dendl;
}
t.write(cid, src, 0, 12, srcbl);
t.write(cid, dst, 0, 12, dstbl);
t.clone_range(cid, src, dst, 2, 8, 2);
- ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr));
+ ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t)));
ASSERT_EQ(12, store->read(ch, dst, 0, 12, result));
ASSERT_EQ(expected, result);
}
t.write(cid, src, 12, 4, srcbl);
t.write(cid, dst, 0, 12, dstbl);
t.clone_range(cid, src, dst, 2, 8, 2);
- ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr));
+ ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t)));
ASSERT_EQ(12, store->read(ch, dst, 0, 12, result));
ASSERT_EQ(expected, result);
}
t.write(cid, src, 8, 4, srcbl);
t.write(cid, dst, 0, 12, dstbl);
t.clone_range(cid, src, dst, 2, 8, 2);
- ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr));
+ ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t)));
ASSERT_EQ(12, store->read(ch, dst, 0, 12, result));
ASSERT_EQ(expected, result);
}
t.write(cid, src, 8, 4, srcbl);
t.write(cid, dst, 0, 12, dstbl);
t.clone_range(cid, src, dst, 2, 8, 2);
- ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr));
+ ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t)));
ASSERT_EQ(12, store->read(ch, dst, 0, 12, result));
ASSERT_EQ(expected, result);
}
t.write(cid, src, 12, 4, srcbl);
t.write(cid, dst, 0, 12, dstbl);
t.clone_range(cid, src, dst, 2, 8, 2);
- ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr));
+ ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t)));
ASSERT_EQ(12, store->read(ch, dst, 0, 12, result));
ASSERT_EQ(expected, result);
}
{
ObjectStore::Transaction t;
t.create_collection(cid, 0);
- os->queue_transaction(ch, std::move(t), nullptr);
+ os->queue_transaction(ch, std::move(t));
}
// create the objects
ObjectStore::Transaction t;
t.touch(cid, oids[i]);
- int r = os->queue_transaction(ch, std::move(t), nullptr);
+ int r = os->queue_transaction(ch, std::move(t));
assert(r == 0);
}
} else {
ObjectStore::Transaction t;
t.touch(cid, oids.back());
- int r = os->queue_transaction(ch, std::move(t), nullptr);
+ int r = os->queue_transaction(ch, std::move(t));
assert(r == 0);
}
ObjectStore::Transaction t;
for (const auto &oid : oids)
t.remove(cid, oid);
- os->queue_transaction(ch, std::move(t), nullptr);
+ os->queue_transaction(ch, std::move(t));
os->umount();
return 0;
test_coll = coll_t(spg_t(pg_t(1, 1)));
ch = store->create_new_collection(test_coll);
t.create_collection(test_coll, 0);
- store->queue_transaction(ch, std::move(t), nullptr);
+ store->queue_transaction(ch, std::move(t));
existing_oid = mk_obj(0);
nonexistent_oid = mk_obj(1);
ghobject_t existing_ghobj(existing_oid);
ObjectStore::Transaction t2;
t2.touch(test_coll, ghobject_t(existing_oid));
t2.setattr(test_coll, ghobject_t(existing_oid), OI_ATTR, enc_oi);
- ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t2), nullptr));
+ ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t2)));
info.last_backfill = hobject_t::get_max();
info.last_complete = eversion_t();
}
test_coll = coll_t(spg_t(pg_t(1, 1)));
auto ch = store->create_new_collection(test_coll);
t.create_collection(test_coll, 0);
- store->queue_transaction(ch, std::move(t), nullptr);
+ store->queue_transaction(ch, std::move(t));
}
void TearDown() override {
t.omap_setkeys(test_coll, log_oid, km);
}
auto ch = store->open_collection(test_coll);
- ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr));
+ ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t)));
auto orig_dups = log.dups;
clear();
dout(0) << "starting thread" << dendl;
foo.create("foo");
dout(0) << "starting op" << dendl;
- fs->queue_transaction(ch, std::move(t), nullptr);
+ fs->queue_transaction(ch, std::move(t));
}
return r;
}
ObjectStore::CollectionHandle ch = store->open_collection(coll_t(r_pgid));
- store->queue_transaction(ch, std::move(rmt), nullptr);
+ store->queue_transaction(ch, std::move(rmt));
finish_remove_pgs(store);
return r;
}
ObjectStore::Transaction t;
t.write(coll_t::meta(), inc_oid, 0, bl.length(), bl);
t.truncate(coll_t::meta(), inc_oid, bl.length());
- int ret = store->queue_transaction(ch, std::move(t), nullptr);
+ int ret = store->queue_transaction(ch, std::move(t));
if (ret) {
cerr << "Failed to set inc-osdmap (" << inc_oid << "): " << ret << std::endl;
} else {
ObjectStore::Transaction t;
t.write(coll_t::meta(), full_oid, 0, bl.length(), bl);
t.truncate(coll_t::meta(), full_oid, bl.length());
- int ret = store->queue_transaction(ch, std::move(t), nullptr);
+ int ret = store->queue_transaction(ch, std::move(t));
if (ret) {
cerr << "Failed to set osdmap (" << full_oid << "): " << ret << std::endl;
} else {
}
}
if (!dry_run)
- store->queue_transaction(ch, std::move(*t), nullptr);
+ store->queue_transaction(ch, std::move(*t));
return 0;
}
encode((char)1, values["_remove"]);
t.omap_setkeys(coll, pgid.make_pgmeta_oid(), values);
- store->queue_transaction(ch, std::move(t), nullptr);
+ store->queue_transaction(ch, std::move(t));
}
cout << "Importing pgid " << pgid;
set<string> remove;
remove.insert("_remove");
t.omap_rmkeys(coll, pgid.make_pgmeta_oid(), remove);
- store->queue_transaction(ch, std::move(t), nullptr);
+ store->queue_transaction(ch, std::move(t));
}
return 0;
}
if (!dry_run)
- store->queue_transaction(ch, std::move(t), nullptr);
+ store->queue_transaction(ch, std::move(t));
return 0;
}
auto ch = store->open_collection(coll);
if (!dry_run)
- store->queue_transaction(ch, std::move(*t), nullptr);
+ store->queue_transaction(ch, std::move(*t));
return 0;
}
t->setattr(coll, ghobj, key, bl);
auto ch = store->open_collection(coll);
- store->queue_transaction(ch, std::move(*t), nullptr);
+ store->queue_transaction(ch, std::move(*t));
return 0;
}
t->rmattr(coll, ghobj, key);
auto ch = store->open_collection(coll);
- store->queue_transaction(ch, std::move(*t), nullptr);
+ store->queue_transaction(ch, std::move(*t));
return 0;
}
t->omap_setkeys(coll, ghobj, attrset);
auto ch = store->open_collection(coll);
- store->queue_transaction(ch, std::move(*t), nullptr);
+ store->queue_transaction(ch, std::move(*t));
return 0;
}
t->omap_rmkeys(coll, ghobj, keys);
auto ch = store->open_collection(coll);
- store->queue_transaction(ch, std::move(*t), nullptr);
+ store->queue_transaction(ch, std::move(*t));
return 0;
}
t->omap_setheader(coll, ghobj, hdrbl);
auto ch = store->open_collection(coll);
- store->queue_transaction(ch, std::move(*t), nullptr);
+ store->queue_transaction(ch, std::move(*t));
return 0;
}
ObjectStore::Transaction t;
t.setattr(coll, ghobj, OI_ATTR, bl);
auto ch = store->open_collection(coll);
- int r = store->queue_transaction(ch, std::move(t), nullptr);
+ int r = store->queue_transaction(ch, std::move(t));
if (r < 0) {
cerr << "Error getting fixing attr on : " << make_pair(coll, ghobj)
<< ", "
t.setattr(coll, head, SS_ATTR, snapattr);
}
auto ch = store->open_collection(coll);
- r = store->queue_transaction(ch, std::move(t), nullptr);
+ r = store->queue_transaction(ch, std::move(t));
if (r < 0) {
cerr << "Error writing object info: " << make_pair(coll, ghobj) << ", "
<< cpp_strerror(r) << std::endl;
ObjectStore::Transaction t;
t.setattr(coll, ghobj, SS_ATTR, bl);
auto ch = store->open_collection(coll);
- int r = store->queue_transaction(ch, std::move(t), nullptr);
+ int r = store->queue_transaction(ch, std::move(t));
if (r < 0) {
cerr << "Error setting snapset on : " << make_pair(coll, ghobj) << ", "
<< cpp_strerror(r) << std::endl;
ObjectStore::Transaction t;
t.setattr(coll, ghobj, SS_ATTR, bl);
auto ch = store->open_collection(coll);
- int r = store->queue_transaction(ch, std::move(t), nullptr);
+ int r = store->queue_transaction(ch, std::move(t));
if (r < 0) {
cerr << "Error setting snapset on : " << make_pair(coll, ghobj) << ", "
<< cpp_strerror(r) << std::endl;
}
}
t.create_collection(cid, bits);
- dst->queue_transaction(dch, std::move(t), nullptr);
+ dst->queue_transaction(dch, std::move(t));
}
ghobject_t pos;
t.omap_setkeys(cid, oid, omap);
}
- dst->queue_transaction(dch, std::move(t), nullptr);
+ dst->queue_transaction(dch, std::move(t));
}
}
cout << " " << std::setw(16) << n << " objects, "
if (ret != 0)
goto out;
auto ch = fs->open_collection(coll_t(pgid));
- fs->queue_transaction(ch, std::move(*t), nullptr);
+ fs->queue_transaction(ch, std::move(*t));
}
cout << "Marking complete succeeded" << std::endl;
} else {