From 907b6281e99ece3677dd7b012cf4955731db6120 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 29 Jan 2018 15:53:26 -0600 Subject: [PATCH] os: apply_transaction -> queue_transaction Signed-off-by: Sage Weil --- src/os/FuseStore.cc | 25 +- src/os/ObjectStore.cc | 21 - src/os/ObjectStore.h | 8 - src/osd/OSD.cc | 30 +- src/osd/PG.cc | 16 +- src/test/fio/fio_ceph_objectstore.cc | 10 +- .../objectstore/DeterministicOpSequence.cc | 18 +- src/test/objectstore/TestObjectStoreState.cc | 2 +- src/test/objectstore/store_test.cc | 610 +++++++++--------- src/test/objectstore/test_idempotent.cc | 2 +- src/test/objectstore/test_memstore_clone.cc | 12 +- src/test/objectstore_bench.cc | 8 +- src/test/osd/TestPGLog.cc | 8 +- src/test/test_trans.cc | 3 +- src/test/xattr_bench.cc | 2 +- src/tools/ceph_objectstore_tool.cc | 42 +- 16 files changed, 384 insertions(+), 433 deletions(-) diff --git a/src/os/FuseStore.cc b/src/os/FuseStore.cc index c95b1873a3ea8..a7f4eaf26ccdd 100644 --- a/src/os/FuseStore.cc +++ b/src/os/FuseStore.cc @@ -775,10 +775,7 @@ static int os_mkdir(const char *path, mode_t mode) } if (!t.empty()) { - fs->store->apply_transaction(ch, std::move(t)); - C_SaferCond waiter; - if (!ch->flush_commit(&waiter)) - waiter.wait(); + fs->store->queue_transaction(ch, std::move(t), nullptr); } return 0; @@ -852,10 +849,7 @@ static int os_create(const char *path, mode_t mode, struct fuse_file_info *fi) } if (!t.empty()) { - fs->store->apply_transaction(ch, std::move(t)); - C_SaferCond waiter; - if (!ch->flush_commit(&waiter)) - waiter.wait(); + fs->store->queue_transaction(ch, std::move(t), nullptr); } if (pbl) { @@ -987,10 +981,7 @@ int os_flush(const char *path, struct fuse_file_info *fi) return 0; } - fs->store->apply_transaction(ch, std::move(t)); - C_SaferCond waiter; - if (!ch->flush_commit(&waiter)) - waiter.wait(); + fs->store->queue_transaction(ch, std::move(t), nullptr); return 0; } @@ -1064,10 +1055,7 @@ static int os_unlink(const char *path) return -EPERM; } - fs->store->apply_transaction(ch, std::move(t)); - C_SaferCond waiter; - if (!ch->flush_commit(&waiter)) - waiter.wait(); + fs->store->queue_transaction(ch, std::move(t), nullptr); return 0; } @@ -1110,10 +1098,7 @@ static int os_truncate(const char *path, off_t size) ObjectStore::CollectionHandle ch = fs->store->open_collection(cid); ObjectStore::Transaction t; t.truncate(cid, oid, size); - fs->store->apply_transaction(ch, std::move(t)); - C_SaferCond waiter; - if (!ch->flush_commit(&waiter)) - waiter.wait(); + fs->store->queue_transaction(ch, std::move(t), nullptr); return 0; } diff --git a/src/os/ObjectStore.cc b/src/os/ObjectStore.cc index 12c9dca711380..3356d8b61e0f6 100644 --- a/src/os/ObjectStore.cc +++ b/src/os/ObjectStore.cc @@ -159,27 +159,6 @@ ostream& operator<<(ostream& out, const ObjectStore::Transaction& tx) { return out << "Transaction(" << &tx << ")"; } - -unsigned ObjectStore::apply_transactions(CollectionHandle& ch, - vector& tls, - Context *ondisk) -{ - // use op pool - Cond my_cond; - Mutex my_lock("ObjectStore::apply_transaction::my_lock"); - int r = 0; - bool done; - C_SafeCond *onreadable = new C_SafeCond(&my_lock, &my_cond, &done, &r); - - queue_transactions(ch, tls, onreadable, ondisk); - - my_lock.Lock(); - while (!done) - my_cond.Wait(my_lock); - my_lock.Unlock(); - return r; -} - int ObjectStore::queue_transactions( CollectionHandle& ch, vector& tls, diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index bb81a1d4ba650..a529266fc0fb0 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -1420,14 +1420,6 @@ public: static void generate_test_instances(list& o); }; - // synchronous wrappers - unsigned apply_transaction(CollectionHandle& ch, Transaction&& t, Context *ondisk=0) { - vector tls; - tls.push_back(std::move(t)); - return apply_transactions(ch, tls, ondisk); - } - unsigned apply_transactions(CollectionHandle& ch, vector& tls, Context *ondisk=0); - int queue_transaction(CollectionHandle& ch, Transaction&& t, Context *onreadable, Context *ondisk=0, Context *onreadable_sync=0, TrackedOpRef op = TrackedOpRef(), diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a6a45b16824d6..892b3a09b1349 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1886,16 +1886,12 @@ int OSD::mkfs(CephContext *cct, ObjectStore *store, const string &dev, ObjectStore::Transaction t; t.create_collection(coll_t::meta(), 0); t.write(coll_t::meta(), OSD_SUPERBLOCK_GOBJECT, 0, bl.length(), bl); - ret = store->apply_transaction(ch, std::move(t)); + ret = store->queue_transaction(ch, std::move(t), nullptr); if (ret) { derr << "OSD::mkfs: error while writing OSD_SUPERBLOCK_GOBJECT: " - << "apply_transaction returned " << cpp_strerror(ret) << dendl; + << "queue_transaction returned " << cpp_strerror(ret) << dendl; goto umount_store; } - C_SaferCond waiter; - if (!ch->flush_commit(&waiter)) { - waiter.wait(); - } } ret = write_meta(cct, store, sb.cluster_fsid, sb.osd_fsid, whoami); @@ -2653,7 +2649,7 @@ int OSD::init() dout(5) << "Upgrading superblock adding: " << diff << dendl; ObjectStore::Transaction t; write_superblock(t); - r = store->apply_transaction(service.meta_ch, std::move(t)); + r = store->queue_transaction(service.meta_ch, std::move(t), nullptr); if (r < 0) goto out; } @@ -2663,7 +2659,7 @@ int OSD::init() dout(10) << "init creating/touching snapmapper object" << dendl; ObjectStore::Transaction t; t.touch(coll_t::meta(), OSD::make_snapmapper_oid()); - r = store->apply_transaction(service.meta_ch, std::move(t)); + r = store->queue_transaction(service.meta_ch, std::move(t), nullptr); if (r < 0) goto out; } @@ -3489,7 +3485,7 @@ int OSD::shutdown() superblock.clean_thru = osdmap->get_epoch(); ObjectStore::Transaction t; write_superblock(t); - int r = store->apply_transaction(service.meta_ch, std::move(t)); + int r = store->queue_transaction(service.meta_ch, std::move(t), nullptr); if (r) { derr << "OSD::shutdown: error writing superblock: " << cpp_strerror(r) << dendl; @@ -3751,13 +3747,13 @@ void OSD::clear_temp_objects() dout(20) << " removing " << *p << " object " << *q << dendl; t.remove(*p, *q); if (++removed > cct->_conf->osd_target_transaction_size) { - store->apply_transaction(service.meta_ch, std::move(t)); + store->queue_transaction(service.meta_ch, std::move(t), nullptr); t = ObjectStore::Transaction(); removed = 0; } } if (removed) { - store->apply_transaction(service.meta_ch, std::move(t)); + store->queue_transaction(service.meta_ch, std::move(t), nullptr); } } } @@ -3791,14 +3787,14 @@ void OSD::recursive_remove_collection(CephContext* cct, ceph_abort(); t.remove(tmp, *p); if (removed > cct->_conf->osd_target_transaction_size) { - int r = store->apply_transaction(ch, std::move(t)); + int r = store->queue_transaction(ch, std::move(t), nullptr); assert(r == 0); t = ObjectStore::Transaction(); removed = 0; } } t.remove_collection(tmp); - int r = store->apply_transaction(ch, std::move(t)); + int r = store->queue_transaction(ch, std::move(t), nullptr); assert(r == 0); C_SaferCond waiter; @@ -5101,7 +5097,7 @@ void TestOpsSocketHook::test_ops(OSDService *service, ObjectStore *store, val.append(valstr); newattrs[key] = val; t.omap_setkeys(coll_t(pgid), ghobject_t(obj), newattrs); - r = store->apply_transaction(service->meta_ch, std::move(t)); + r = store->queue_transaction(service->meta_ch, std::move(t), nullptr); if (r < 0) ss << "error=" << r; else @@ -5113,7 +5109,7 @@ void TestOpsSocketHook::test_ops(OSDService *service, ObjectStore *store, keys.insert(key); t.omap_rmkeys(coll_t(pgid), ghobject_t(obj), keys); - r = store->apply_transaction(service->meta_ch, std::move(t)); + r = store->queue_transaction(service->meta_ch, std::move(t), nullptr); if (r < 0) ss << "error=" << r; else @@ -5125,7 +5121,7 @@ void TestOpsSocketHook::test_ops(OSDService *service, ObjectStore *store, cmd_getval(service->cct, cmdmap, "header", headerstr); newheader.append(headerstr); t.omap_setheader(coll_t(pgid), ghobject_t(obj), newheader); - r = store->apply_transaction(service->meta_ch, std::move(t)); + r = store->queue_transaction(service->meta_ch, std::move(t), nullptr); if (r < 0) ss << "error=" << r; else @@ -5154,7 +5150,7 @@ void TestOpsSocketHook::test_ops(OSDService *service, ObjectStore *store, int64_t trunclen; cmd_getval(service->cct, cmdmap, "len", trunclen); t.truncate(coll_t(pgid), ghobject_t(obj), trunclen); - r = store->apply_transaction(service->meta_ch, std::move(t)); + r = store->queue_transaction(service->meta_ch, std::move(t), nullptr); if (r < 0) ss << "error=" << r; else diff --git a/src/osd/PG.cc b/src/osd/PG.cc index ed0277e79c441..856c2b5bd983e 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3053,9 +3053,9 @@ void PG::upgrade(ObjectStore *store) write_if_dirty(t); ObjectStore::CollectionHandle ch = store->open_collection(coll); - int r = store->apply_transaction(ch, std::move(t)); + int r = store->queue_transaction(ch, std::move(t), nullptr); if (r != 0) { - derr << __func__ << ": apply_transaction returned " + derr << __func__ << ": queue_transaction returned " << cpp_strerror(r) << dendl; ceph_abort(); } @@ -3522,7 +3522,7 @@ void PG::read_state(ObjectStore *store) PG::RecoveryCtx rctx(0, 0, 0, 0, 0, new ObjectStore::Transaction); handle_loaded(&rctx); write_if_dirty(*rctx.transaction); - store->apply_transaction(ch, std::move(*rctx.transaction)); + store->queue_transaction(ch, std::move(*rctx.transaction), nullptr); delete rctx.transaction; } @@ -4185,9 +4185,9 @@ void PG::_scan_snaps(ScrubMap &smap) << "...repaired"; } snap_mapper.add_oid(hoid, obj_snaps, &_t); - r = osd->store->apply_transaction(ch, std::move(t)); + r = osd->store->queue_transaction(ch, std::move(t), nullptr); if (r != 0) { - derr << __func__ << ": apply_transaction got " << cpp_strerror(r) + derr << __func__ << ": queue_transaction got " << cpp_strerror(r) << dendl; } } @@ -4232,9 +4232,9 @@ void PG::_repair_oinfo_oid(ScrubMap &smap) o.attrs[OI_ATTR] = bp; t.setattr(coll, ghobject_t(hoid), OI_ATTR, bl); - int r = osd->store->apply_transaction(ch, std::move(t)); + int r = osd->store->queue_transaction(ch, std::move(t), nullptr); if (r != 0) { - derr << __func__ << ": apply_transaction got " << cpp_strerror(r) + derr << __func__ << ": queue_transaction got " << cpp_strerror(r) << dendl; } } @@ -6209,7 +6209,7 @@ void PG::update_store_on_load() lderr(cct) << __func__ << " setting bit width to " << bits << dendl; ObjectStore::Transaction t; t.collection_set_bits(coll, bits); - osd->store->apply_transaction(ch, std::move(t)); + osd->store->queue_transaction(ch, std::move(t), nullptr); } } } diff --git a/src/test/fio/fio_ceph_objectstore.cc b/src/test/fio/fio_ceph_objectstore.cc index 4236197d3ffd4..7d573ca86806d 100644 --- a/src/test/fio/fio_ceph_objectstore.cc +++ b/src/test/fio/fio_ceph_objectstore.cc @@ -170,7 +170,7 @@ int destroy_collections( ghobject_t pgmeta_oid(coll.pg.make_pgmeta_oid()); t.remove(coll.cid, pgmeta_oid); t.remove_collection(coll.cid); - int r = os->apply_transaction(coll.ch, std::move(t)); + int r = os->queue_transaction(coll.ch, std::move(t)); if (r && !failed) { derr << "Engine cleanup failed with " << cpp_strerror(-r) << dendl; failed = true; @@ -204,7 +204,7 @@ int init_collections(std::unique_ptr& os, ObjectStore::Transaction t; t.create_collection(cid, split_bits); t.write(cid, OSD_SUPERBLOCK_GOBJECT, 0, bl.length(), bl); - int r = os->apply_transaction(ch, std::move(t)); + int r = os->queue_transaction(ch, std::move(t)); if (r < 0) { derr << "Failure to write OSD superblock: " << cpp_strerror(-r) << dendl; @@ -230,7 +230,7 @@ int init_collections(std::unique_ptr& os, t.create_collection(coll.cid, split_bits); ghobject_t pgmeta_oid(coll.pg.make_pgmeta_oid()); t.touch(coll.cid, pgmeta_oid); - int r = os->apply_transaction(coll.ch, std::move(t)); + int r = os->queue_transaction(coll.ch, std::move(t)); if (r) { derr << "Engine init failed with " << cpp_strerror(-r) << dendl; destroy_collections(os, collections); @@ -437,7 +437,7 @@ Job::Job(Engine* engine, const thread_data* td) auto& oid = objects.back().oid; t.touch(coll.cid, oid); t.truncate(coll.cid, oid, file_size); - int r = engine->os->apply_transaction(coll.ch, std::move(t)); + int r = engine->os->queue_transaction(coll.ch, std::move(t)); if (r) { engine->deref(); throw std::system_error(r, std::system_category(), "job init"); @@ -453,7 +453,7 @@ Job::~Job() // remove our objects for (auto& obj : objects) { t.remove(obj.coll.cid, obj.oid); - int r = engine->os->apply_transaction(obj.coll.ch, std::move(t)); + int r = engine->os->queue_transaction(obj.coll.ch, std::move(t)); if (r && !failed) { derr << "job cleanup failed with " << cpp_strerror(-r) << dendl; failed = true; diff --git a/src/test/objectstore/DeterministicOpSequence.cc b/src/test/objectstore/DeterministicOpSequence.cc index 6e59b502ffba4..e501712e167eb 100644 --- a/src/test/objectstore/DeterministicOpSequence.cc +++ b/src/test/objectstore/DeterministicOpSequence.cc @@ -405,7 +405,7 @@ void DeterministicOpSequence::_do_coll_create(coll_entry_t *entry, uint32_t pg_n << " a hint, pg_num is: " << pg_num << ", num_objs is: " << num_objs << dendl; - m_store->apply_transaction(entry->m_ch, std::move(t)); + m_store->queue_transaction(entry->m_ch, std::move(t)); } void DeterministicOpSequence::_do_touch(coll_entry_t *entry, hobject_t& obj) @@ -413,7 +413,7 @@ void DeterministicOpSequence::_do_touch(coll_entry_t *entry, hobject_t& obj) ObjectStore::Transaction t; note_txn(&t); t.touch(entry->m_cid, ghobject_t(obj)); - m_store->apply_transaction(entry->m_ch, std::move(t)); + m_store->queue_transaction(entry->m_ch, std::move(t)); } void DeterministicOpSequence::_do_remove(coll_entry_t *entry, hobject_t& obj) @@ -421,7 +421,7 @@ void DeterministicOpSequence::_do_remove(coll_entry_t *entry, hobject_t& obj) ObjectStore::Transaction t; note_txn(&t); t.remove(entry->m_cid, ghobject_t(obj)); - m_store->apply_transaction(entry->m_ch, std::move(t)); + m_store->queue_transaction(entry->m_ch, std::move(t)); } void DeterministicOpSequence::_do_set_attrs(coll_entry_t *entry, @@ -431,7 +431,7 @@ void DeterministicOpSequence::_do_set_attrs(coll_entry_t *entry, ObjectStore::Transaction t; note_txn(&t); t.omap_setkeys(entry->m_cid, ghobject_t(obj), attrs); - m_store->apply_transaction(entry->m_ch, std::move(t)); + m_store->queue_transaction(entry->m_ch, std::move(t)); } void DeterministicOpSequence::_do_write(coll_entry_t *entry, hobject_t& obj, @@ -440,7 +440,7 @@ void DeterministicOpSequence::_do_write(coll_entry_t *entry, hobject_t& obj, ObjectStore::Transaction t; note_txn(&t); t.write(entry->m_cid, ghobject_t(obj), off, len, data); - m_store->apply_transaction(entry->m_ch, std::move(t)); + m_store->queue_transaction(entry->m_ch, std::move(t)); } void DeterministicOpSequence::_do_clone(coll_entry_t *entry, hobject_t& orig_obj, @@ -449,7 +449,7 @@ void DeterministicOpSequence::_do_clone(coll_entry_t *entry, hobject_t& orig_obj ObjectStore::Transaction t; note_txn(&t); t.clone(entry->m_cid, ghobject_t(orig_obj), ghobject_t(new_obj)); - m_store->apply_transaction(entry->m_ch, std::move(t)); + m_store->queue_transaction(entry->m_ch, std::move(t)); } void DeterministicOpSequence::_do_clone_range(coll_entry_t *entry, @@ -460,7 +460,7 @@ void DeterministicOpSequence::_do_clone_range(coll_entry_t *entry, note_txn(&t); t.clone_range(entry->m_cid, ghobject_t(orig_obj), ghobject_t(new_obj), srcoff, srclen, dstoff); - m_store->apply_transaction(entry->m_ch, std::move(t)); + m_store->queue_transaction(entry->m_ch, std::move(t)); } void DeterministicOpSequence::_do_write_and_clone_range(coll_entry_t *entry, @@ -476,7 +476,7 @@ void DeterministicOpSequence::_do_write_and_clone_range(coll_entry_t *entry, t.write(entry->m_cid, ghobject_t(orig_obj), srcoff, bl.length(), bl); t.clone_range(entry->m_cid, ghobject_t(orig_obj), ghobject_t(new_obj), srcoff, srclen, dstoff); - m_store->apply_transaction(entry->m_ch, std::move(t)); + m_store->queue_transaction(entry->m_ch, std::move(t)); } void DeterministicOpSequence::_do_coll_move(coll_entry_t *entry, @@ -488,6 +488,6 @@ void DeterministicOpSequence::_do_coll_move(coll_entry_t *entry, t.remove(entry->m_cid, ghobject_t(new_obj)); t.collection_move_rename(entry->m_cid, ghobject_t(orig_obj), entry->m_cid, ghobject_t(new_obj)); - m_store->apply_transaction(entry->m_ch, std::move(t)); + m_store->queue_transaction(entry->m_ch, std::move(t)); } diff --git a/src/test/objectstore/TestObjectStoreState.cc b/src/test/objectstore/TestObjectStoreState.cc index f52bfb5b738ab..5a8f90131f3f0 100644 --- a/src/test/objectstore/TestObjectStoreState.cc +++ b/src/test/objectstore/TestObjectStoreState.cc @@ -37,7 +37,7 @@ void TestObjectStoreState::init(int colls, int objs) ObjectStore::Transaction t; auto meta_ch = m_store->create_new_collection(coll_t::meta()); t.create_collection(coll_t::meta(), 0); - m_store->apply_transaction(meta_ch, std::move(t)); + m_store->queue_transaction(meta_ch, std::move(t), nullptr); wait_for_ready(); diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 7fa2eb3aef938..1bf0e96d63b2f 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -87,16 +87,16 @@ static bool bl_eq(bufferlist& expected, bufferlist& actual) template -int apply_transaction( +int queue_transaction( T &store, ObjectStore::CollectionHandle ch, ObjectStore::Transaction &&t) { if (rand() % 2) { ObjectStore::Transaction t2; t2.append(t); - return store->apply_transaction(ch, std::move(t2)); + return store->queue_transaction(ch, std::move(t2), nullptr, nullptr); } else { - return store->apply_transaction(ch, std::move(t)); + return store->queue_transaction(ch, std::move(t), nullptr, nullptr); } } @@ -293,7 +293,7 @@ TEST_P(StoreTest, SimpleRemount) { ObjectStore::Transaction t; t.create_collection(cid, 0); t.write(cid, hoid, 0, bl.length(), bl); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ch.reset(); @@ -305,7 +305,7 @@ TEST_P(StoreTest, SimpleRemount) { { ObjectStore::Transaction t; t.write(cid, hoid2, 0, bl.length(), bl); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -314,7 +314,7 @@ TEST_P(StoreTest, SimpleRemount) { t.remove(cid, hoid2); t.remove_collection(cid); cerr << "remove collection" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ch.reset(); @@ -326,7 +326,7 @@ TEST_P(StoreTest, SimpleRemount) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bool exists = store->exists(ch, hoid); ASSERT_TRUE(!exists); @@ -335,7 +335,7 @@ TEST_P(StoreTest, SimpleRemount) { ObjectStore::Transaction t; t.remove_collection(cid); cerr << "remove collection" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -354,7 +354,7 @@ TEST_P(StoreTest, IORemount) { ghobject_t hoid(hobject_t(sobject_t("Object " + stringify(n), CEPH_NOSNAP))); t.write(cid, hoid, 0, bl.length(), bl); } - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } // overwrites @@ -364,7 +364,7 @@ TEST_P(StoreTest, IORemount) { ObjectStore::Transaction t; ghobject_t hoid(hobject_t(sobject_t("Object " + stringify(n), CEPH_NOSNAP))); t.write(cid, hoid, 1, bl.length(), bl); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -381,7 +381,7 @@ TEST_P(StoreTest, IORemount) { } t.remove_collection(cid); auto ch = store->open_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -400,7 +400,7 @@ TEST_P(StoreTest, UnprintableCharsName) { ObjectStore::Transaction t; t.create_collection(cid, 0); t.touch(cid, oid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ch.reset(); @@ -414,7 +414,7 @@ TEST_P(StoreTest, UnprintableCharsName) { t.remove(cid, oid); t.remove_collection(cid); auto ch = store->open_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -429,7 +429,7 @@ TEST_P(StoreTest, FiemapEmpty) { t.create_collection(cid, 0); t.touch(cid, oid); t.truncate(cid, oid, 100000); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -447,7 +447,7 @@ TEST_P(StoreTest, FiemapEmpty) { t.remove(cid, oid); t.remove_collection(cid); cerr << "remove collection" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -467,7 +467,7 @@ TEST_P(StoreTest, FiemapHoles) { t.touch(cid, oid); for (uint64_t i = 0; i < MAX_EXTENTS; i++) t.write(cid, oid, SKIP_STEP * i, 3, bl); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -519,7 +519,7 @@ TEST_P(StoreTest, FiemapHoles) { t.remove(cid, oid); t.remove_collection(cid); cerr << "remove collection" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -532,7 +532,7 @@ TEST_P(StoreTest, SimpleMetaColTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "create collection" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -540,7 +540,7 @@ TEST_P(StoreTest, SimpleMetaColTest) { t.remove_collection(cid); cerr << "remove collection" << std::endl; auto ch = store->open_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -548,7 +548,7 @@ TEST_P(StoreTest, SimpleMetaColTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "add collection" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -556,7 +556,7 @@ TEST_P(StoreTest, SimpleMetaColTest) { t.remove_collection(cid); cerr << "remove collection" << std::endl; auto ch = store->open_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -569,7 +569,7 @@ TEST_P(StoreTest, SimplePGColTest) { auto ch = store->create_new_collection(cid); t.create_collection(cid, 4); cerr << "create collection" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -577,7 +577,7 @@ TEST_P(StoreTest, SimplePGColTest) { t.remove_collection(cid); cerr << "remove collection" << std::endl; auto ch = store->open_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -585,7 +585,7 @@ TEST_P(StoreTest, SimplePGColTest) { t.create_collection(cid, 4); cerr << "add collection" << std::endl; auto ch = store->create_new_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -593,7 +593,7 @@ TEST_P(StoreTest, SimplePGColTest) { t.remove_collection(cid); cerr << "remove collection" << std::endl; auto ch = store->open_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -631,7 +631,7 @@ TEST_P(StoreTest, SimpleColPreHashTest) { encode(expected_num_objs, hint); t.collection_hint(cid, ObjectStore::Transaction::COLL_HINT_EXPECTED_NUM_OBJECTS, hint); cerr << "collection hint" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -639,7 +639,7 @@ TEST_P(StoreTest, SimpleColPreHashTest) { ObjectStore::Transaction t; t.remove_collection(cid); cerr << "remove collection" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } // Revert the config change so that it does not affect the split/merge tests @@ -659,7 +659,7 @@ TEST_P(StoreTest, SmallBlockWrites) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist a; @@ -681,7 +681,7 @@ TEST_P(StoreTest, SmallBlockWrites) { { ObjectStore::Transaction t; t.write(cid, hoid, 0, 0x1000, a); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist in, exp; @@ -693,7 +693,7 @@ TEST_P(StoreTest, SmallBlockWrites) { { ObjectStore::Transaction t; t.write(cid, hoid, 0x1000, 0x1000, b); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist in, exp; @@ -706,7 +706,7 @@ TEST_P(StoreTest, SmallBlockWrites) { { ObjectStore::Transaction t; t.write(cid, hoid, 0x3000, 0x1000, c); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist in, exp; @@ -721,7 +721,7 @@ TEST_P(StoreTest, SmallBlockWrites) { { ObjectStore::Transaction t; t.write(cid, hoid, 0x2000, 0x1000, a); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist in, exp; @@ -736,7 +736,7 @@ TEST_P(StoreTest, SmallBlockWrites) { { ObjectStore::Transaction t; t.write(cid, hoid, 0, 0x1000, c); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -754,7 +754,7 @@ TEST_P(StoreTest, SmallBlockWrites) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -772,7 +772,7 @@ TEST_P(StoreTest, BufferCacheReadTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -782,7 +782,7 @@ TEST_P(StoreTest, BufferCacheReadTest) { ObjectStore::Transaction t; t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); exists = store->exists(ch, hoid); @@ -795,7 +795,7 @@ TEST_P(StoreTest, BufferCacheReadTest) { t.write(cid, hoid, 0, 5, bl); t.write(cid, hoid, 10, 5, bl); cerr << "TwinWrite" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid, 0, 15, newdata); @@ -816,7 +816,7 @@ TEST_P(StoreTest, BufferCacheReadTest) { t.write(cid, hoid, 0, 5, bl); t.write(cid, hoid, 10, 5, bl); cerr << "TwinWrite" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid, 0, 15, newdata); @@ -837,7 +837,7 @@ TEST_P(StoreTest, BufferCacheReadTest) { t.write(cid, hoid, 20, bl2.length(), bl2); cerr << "Append" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid, 0, 30, newdata); @@ -865,7 +865,7 @@ TEST_P(StoreTest, BufferCacheReadTest) { t.write(cid, hoid, 1, bl.length(), bl); t.write(cid, hoid, 13, bl3.length(), bl3); cerr << "TripleWrite" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid, 0, 40, newdata); @@ -898,7 +898,7 @@ void doCompressionTest( boost::scoped_ptr& store) ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -908,7 +908,7 @@ void doCompressionTest( boost::scoped_ptr& store) ObjectStore::Transaction t; t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); exists = store->exists(ch, hoid); @@ -924,7 +924,7 @@ void doCompressionTest( boost::scoped_ptr& store) bl.append(data); t.write(cid, hoid, 0, bl.length(), bl); cerr << "CompressibleData (4xAU) Write" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid, 0, data.size() , newdata); @@ -971,7 +971,7 @@ void doCompressionTest( boost::scoped_ptr& store) bl.append(data2); t.write(cid, hoid, 0x8000, bl.length(), bl); cerr << "CompressibleData partial overwrite" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid, 0, 0x10000, newdata); @@ -1010,7 +1010,7 @@ void doCompressionTest( boost::scoped_ptr& store) bl.append(data2); t.write(cid, hoid, 0, bl.length(), bl); cerr << "CompressibleData partial overwrite, two extents overlapped, single one to be removed" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid, 0, 0x3e000 - 1, newdata); @@ -1048,7 +1048,7 @@ void doCompressionTest( boost::scoped_ptr& store) bl.append(data); t.write(cid, hoid, 0x3f000-1, bl.length(), bl); cerr << "Small chunk partial overwrite, two extents overlapped, single one to be removed" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid, 0x3e000, 0x2000, newdata); @@ -1064,7 +1064,7 @@ void doCompressionTest( boost::scoped_ptr& store) ObjectStore::Transaction t; t.remove(cid, hoid); cerr << "Cleaning object" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } //force fsck @@ -1085,7 +1085,7 @@ void doCompressionTest( boost::scoped_ptr& store) bl.append(data); t.write(cid, hoid, 0, bl.length(), bl); cerr << "CompressibleData large blob" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } //force fsck @@ -1098,7 +1098,7 @@ void doCompressionTest( boost::scoped_ptr& store) t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } g_conf->set_val("bluestore_compression_min_blob_size", stringify(orig_min_blob_size)); @@ -1140,7 +1140,7 @@ TEST_P(StoreTest, SimpleObjectTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -1150,7 +1150,7 @@ TEST_P(StoreTest, SimpleObjectTest) { ObjectStore::Transaction t; t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); exists = store->exists(ch, hoid); @@ -1161,7 +1161,7 @@ TEST_P(StoreTest, SimpleObjectTest) { t.remove(cid, hoid); t.touch(cid, hoid); cerr << "Remove then create" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -1172,7 +1172,7 @@ TEST_P(StoreTest, SimpleObjectTest) { t.remove(cid, hoid); t.write(cid, hoid, 0, 5, bl); cerr << "Remove then create" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist in; @@ -1188,7 +1188,7 @@ TEST_P(StoreTest, SimpleObjectTest) { exp.append(bl); t.write(cid, hoid, 5, 5, bl); cerr << "Append" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist in; @@ -1203,7 +1203,7 @@ TEST_P(StoreTest, SimpleObjectTest) { exp = bl; t.write(cid, hoid, 0, 10, bl); cerr << "Full overwrite" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist in; @@ -1217,7 +1217,7 @@ TEST_P(StoreTest, SimpleObjectTest) { bl.append("abcde"); t.write(cid, hoid, 3, 5, bl); cerr << "Partial overwrite" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist in, exp; @@ -1235,7 +1235,7 @@ TEST_P(StoreTest, SimpleObjectTest) { t.truncate(cid, hoid, 0); t.write(cid, hoid, 5, 5, bl); cerr << "Truncate + hole" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -1244,7 +1244,7 @@ TEST_P(StoreTest, SimpleObjectTest) { bl.append("abcde"); t.write(cid, hoid, 0, 5, bl); cerr << "Reverse fill-in" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -1261,7 +1261,7 @@ TEST_P(StoreTest, SimpleObjectTest) { bl.append("abcde01234012340123401234abcde01234012340123401234abcde01234012340123401234abcde01234012340123401234"); t.write(cid, hoid, 0, bl.length(), bl); cerr << "larger overwrite" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist in; @@ -1292,7 +1292,7 @@ TEST_P(StoreTest, SimpleObjectTest) { t.truncate(cid, hoid, 0); t.write(cid, hoid, 0x1000-1, bl.length(), bl); cerr << "Write unaligned csum, stage 1" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -1314,7 +1314,7 @@ TEST_P(StoreTest, SimpleObjectTest) { bl.append(s3); t.write(cid, hoid, 1, bl.length(), bl); cerr << "Write unaligned csum, stage 2" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } in.clear(); @@ -1337,7 +1337,7 @@ TEST_P(StoreTest, SimpleObjectTest) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -1367,7 +1367,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -1377,7 +1377,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { ObjectStore::Transaction t; t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); exists = store->exists(ch, hoid); @@ -1403,7 +1403,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { bl.append("abcde"); t.write(cid, hoid, 0, 5, bl); cerr << "Append 5 bytes" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1427,7 +1427,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { bl.append(s); t.write(cid, hoid, 0x10000, bl.length(), bl); cerr << "Append 0x30000 compressible bytes" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1449,7 +1449,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { t.zero(cid, hoid, 1, 3); t.zero(cid, hoid, 0x20000, 9); cerr << "Punch hole at 1~3, 0x20000~9" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1474,7 +1474,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { t.write(cid, hoid, 1, bl.length(), bl); t.write(cid, hoid, 0x10001, bl.length(), bl); cerr << "Overwrite first and second(compressible) extents" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1500,7 +1500,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { t.write(cid, hoid, 0x20000, bl.length(), bl); t.write(cid, hoid, 0x30000, bl.length(), bl); cerr << "Overwrite compressed extent with 3 uncompressible ones" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1521,7 +1521,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { ObjectStore::Transaction t; t.zero(cid, hoid, 0, 0x40000); cerr << "Zero object" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; int r = store->statfs(&statfs); @@ -1547,7 +1547,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { bl.append(s.substr(0, 0x10000-2)); t.write(cid, hoid, 0, bl.length(), bl); cerr << "Yet another compressible write" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; r = store->statfs(&statfs); @@ -1571,7 +1571,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { ObjectStore::Transaction t; t.clone(cid, hoid, hoid2); cerr << "Clone compressed objecte" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs2; r = store->statfs(&statfs2); @@ -1589,7 +1589,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) { t.remove(cid, hoid2); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1619,7 +1619,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreFragmentedBlobTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -1629,7 +1629,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreFragmentedBlobTest) { ObjectStore::Transaction t; t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); exists = store->exists(ch, hoid); @@ -1655,7 +1655,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreFragmentedBlobTest) { t.write(cid, hoid, 0, bl.length(), bl); t.zero(cid, hoid, 0x10000, 0x10000); cerr << "Append 3*0x10000 bytes and punch a hole 0x10000~10000" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1699,7 +1699,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreFragmentedBlobTest) { bl.append(data2); t.write(cid, hoid, 0x20000, bl.length(), bl); cerr << "Write 3 bytes after the hole" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1732,7 +1732,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreFragmentedBlobTest) { bl.append(data2); t.write(cid, hoid, 0x10000+1, bl.length(), bl); cerr << "Write 3 bytes to the hole" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1763,7 +1763,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreFragmentedBlobTest) { t.zero(cid, hoid, 0, 0x10000); t.zero(cid, hoid, 0x20000, 0x10000); cerr << "Rewrite an object and create two holes at the begining and the end" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1795,7 +1795,7 @@ TEST_P(StoreTestSpecificAUSize, BluestoreFragmentedBlobTest) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct store_statfs_t statfs; @@ -1820,7 +1820,7 @@ TEST_P(StoreTest, ManySmallWrite) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist bl; @@ -1830,13 +1830,13 @@ TEST_P(StoreTest, ManySmallWrite) { for (int i=0; i<100; ++i) { ObjectStore::Transaction t; t.write(cid, a, i*4096, 4096, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } for (int i=0; i<100; ++i) { ObjectStore::Transaction t; t.write(cid, b, (rand() % 1024)*4096, 4096, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -1845,7 +1845,7 @@ TEST_P(StoreTest, ManySmallWrite) { t.remove(cid, b); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -1859,7 +1859,7 @@ TEST_P(StoreTest, MultiSmallWriteSameBlock) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist bl; @@ -1900,7 +1900,7 @@ TEST_P(StoreTest, MultiSmallWriteSameBlock) { t.remove(cid, a); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -1914,14 +1914,14 @@ TEST_P(StoreTest, SmallSkipFront) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.touch(cid, a); t.truncate(cid, a, 3000); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -1931,7 +1931,7 @@ TEST_P(StoreTest, SmallSkipFront) { bl.append(bp); ObjectStore::Transaction t; t.write(cid, a, 4096, 4096, bl); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -1947,7 +1947,7 @@ TEST_P(StoreTest, SmallSkipFront) { t.remove(cid, a); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -1961,7 +1961,7 @@ TEST_P(StoreTest, AppendDeferredVsTailCache) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } unsigned min_alloc = g_conf->bluestore_min_alloc_size; @@ -1975,7 +1975,7 @@ TEST_P(StoreTest, AppendDeferredVsTailCache) { { ObjectStore::Transaction t; t.write(cid, a, 0, bla.length(), bla, 0); - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } @@ -1996,7 +1996,7 @@ TEST_P(StoreTest, AppendDeferredVsTailCache) { { ObjectStore::Transaction t; t.write(cid, a, bla.length(), blb.length(), blb, 0); - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } bufferptr bpc(size); @@ -2006,7 +2006,7 @@ TEST_P(StoreTest, AppendDeferredVsTailCache) { { ObjectStore::Transaction t; t.write(cid, a, bla.length() + blb.length(), blc.length(), blc, 0); - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } bufferlist final; @@ -2024,7 +2024,7 @@ TEST_P(StoreTest, AppendDeferredVsTailCache) { t.remove(cid, a); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } g_conf->set_val("bluestore_inject_deferred_apply_delay", "0"); @@ -2042,7 +2042,7 @@ TEST_P(StoreTest, AppendZeroTrailingSharedBlock) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } unsigned min_alloc = g_conf->bluestore_min_alloc_size; @@ -2058,13 +2058,13 @@ TEST_P(StoreTest, AppendZeroTrailingSharedBlock) { bt.append("BADBADBADBAD"); ObjectStore::Transaction t; t.write(cid, a, 0, bt.length(), bt, 0); - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.truncate(cid, a, size); - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } @@ -2072,7 +2072,7 @@ TEST_P(StoreTest, AppendZeroTrailingSharedBlock) { { ObjectStore::Transaction t; t.clone(cid, a, b); - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } @@ -2084,7 +2084,7 @@ TEST_P(StoreTest, AppendZeroTrailingSharedBlock) { { ObjectStore::Transaction t; t.write(cid, a, min_alloc * 3, blb.length(), blb, 0); - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } bufferlist final; @@ -2107,7 +2107,7 @@ TEST_P(StoreTest, AppendZeroTrailingSharedBlock) { t.remove(cid, b); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); ASSERT_EQ(r, 0); } } @@ -2121,7 +2121,7 @@ TEST_P(StoreTest, SmallSequentialUnaligned) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist bl; @@ -2132,7 +2132,7 @@ TEST_P(StoreTest, SmallSequentialUnaligned) { for (int i=0; i<1000; ++i) { ObjectStore::Transaction t; t.write(cid, a, i*len, len, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -2140,7 +2140,7 @@ TEST_P(StoreTest, SmallSequentialUnaligned) { t.remove(cid, a); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -2155,7 +2155,7 @@ TEST_P(StoreTest, ManyBigWrite) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist bl; @@ -2165,28 +2165,28 @@ TEST_P(StoreTest, ManyBigWrite) { for (int i=0; i<10; ++i) { ObjectStore::Transaction t; t.write(cid, a, i*4*1048586, 4*1048576, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } // aligned for (int i=0; i<10; ++i) { ObjectStore::Transaction t; t.write(cid, b, (rand() % 256)*4*1048576, 4*1048576, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } // unaligned for (int i=0; i<10; ++i) { ObjectStore::Transaction t; t.write(cid, b, (rand() % (256*4096))*1024, 4*1048576, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } // do some zeros for (int i=0; i<10; ++i) { ObjectStore::Transaction t; t.zero(cid, b, (rand() % (256*4096))*1024, 16*1048576); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -2195,7 +2195,7 @@ TEST_P(StoreTest, ManyBigWrite) { t.remove(cid, b); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -2208,7 +2208,7 @@ TEST_P(StoreTest, BigWriteBigZero) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist bl; @@ -2222,26 +2222,26 @@ TEST_P(StoreTest, BigWriteBigZero) { { ObjectStore::Transaction t; t.write(cid, a, 0, bl.length(), bl); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.zero(cid, a, bl.length() / 4, bl.length() / 2); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.write(cid, a, bl.length() / 2, s.length(), s); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.remove(cid, a); t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -2255,7 +2255,7 @@ TEST_P(StoreTest, MiscFragmentTests) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist bl; @@ -2265,13 +2265,13 @@ TEST_P(StoreTest, MiscFragmentTests) { { ObjectStore::Transaction t; t.write(cid, a, 0, 524288, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.write(cid, a, 1048576, 524288, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -2284,7 +2284,7 @@ TEST_P(StoreTest, MiscFragmentTests) { { ObjectStore::Transaction t; t.write(cid, a, 1048576 - 4096, 524288, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -2292,7 +2292,7 @@ TEST_P(StoreTest, MiscFragmentTests) { t.remove(cid, a); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -2308,7 +2308,7 @@ TEST_P(StoreTest, ZeroVsObjectSize) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist a; @@ -2316,7 +2316,7 @@ TEST_P(StoreTest, ZeroVsObjectSize) { { ObjectStore::Transaction t; t.write(cid, hoid, 0, 5, a); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_EQ(0, store->stat(ch, hoid, &stat)); @@ -2324,7 +2324,7 @@ TEST_P(StoreTest, ZeroVsObjectSize) { { ObjectStore::Transaction t; t.zero(cid, hoid, 1, 2); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_EQ(0, store->stat(ch, hoid, &stat)); @@ -2332,7 +2332,7 @@ TEST_P(StoreTest, ZeroVsObjectSize) { { ObjectStore::Transaction t; t.zero(cid, hoid, 3, 200); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_EQ(0, store->stat(ch, hoid, &stat)); @@ -2340,7 +2340,7 @@ TEST_P(StoreTest, ZeroVsObjectSize) { { ObjectStore::Transaction t; t.zero(cid, hoid, 100000, 200); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_EQ(0, store->stat(ch, hoid, &stat)); @@ -2356,14 +2356,14 @@ TEST_P(StoreTest, ZeroLengthWrite) { ObjectStore::Transaction t; t.create_collection(cid, 0); t.touch(cid, hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; bufferlist empty; t.write(cid, hoid, 1048576, 0, empty); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } struct stat stat; @@ -2385,13 +2385,13 @@ TEST_P(StoreTest, ZeroLengthZero) { ObjectStore::Transaction t; t.create_collection(cid, 0); t.touch(cid, hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(0, r); } { ObjectStore::Transaction t; t.zero(cid, hoid, 1048576, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(0, r); } struct stat stat; @@ -2419,7 +2419,7 @@ TEST_P(StoreTest, SimpleAttrTest) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -2438,7 +2438,7 @@ TEST_P(StoreTest, SimpleAttrTest) { t.touch(cid, hoid); t.setattr(cid, hoid, "foo", val); t.setattr(cid, hoid, "bar", val2); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -2467,7 +2467,7 @@ TEST_P(StoreTest, SimpleAttrTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -2480,7 +2480,7 @@ TEST_P(StoreTest, SimpleListTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } set all; @@ -2496,7 +2496,7 @@ TEST_P(StoreTest, SimpleListTest) { t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; } - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -2531,7 +2531,7 @@ TEST_P(StoreTest, SimpleListTest) { t.remove(cid, *p); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -2544,7 +2544,7 @@ TEST_P(StoreTest, ListEndTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } set all; @@ -2560,7 +2560,7 @@ TEST_P(StoreTest, ListEndTest) { t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; } - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -2582,7 +2582,7 @@ TEST_P(StoreTest, ListEndTest) { t.remove(cid, *p); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -2624,7 +2624,7 @@ TEST_P(StoreTest, MultipoolListTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } set all, saw; @@ -2642,7 +2642,7 @@ TEST_P(StoreTest, MultipoolListTest) { t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; } - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -2668,7 +2668,7 @@ TEST_P(StoreTest, MultipoolListTest) { t.remove(cid, *p); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -2681,7 +2681,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ghobject_t hoid(hobject_t(sobject_t("Object 1", CEPH_NOSNAP), @@ -2699,7 +2699,7 @@ TEST_P(StoreTest, SimpleCloneTest) { t.write(cid, hoid, 0, small.length(), small); t.write(cid, hoid, 10, small.length(), small); cerr << "Creating object and set attr " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -2715,7 +2715,7 @@ TEST_P(StoreTest, SimpleCloneTest) { t.setattr(cid, hoid, "attr1", large); t.setattr(cid, hoid, "attr2", small); cerr << "Clone object and rm attr" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid, 10, 5, newdata); @@ -2750,7 +2750,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); } { bufferlist final; @@ -2768,7 +2768,7 @@ TEST_P(StoreTest, SimpleCloneTest) { al.append(a); final.append(a); t.write(cid, hoid, pl.length(), a.length(), al); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist rl; ASSERT_EQ((int)final.length(), @@ -2779,7 +2779,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); } { bufferlist final; @@ -2800,7 +2800,7 @@ TEST_P(StoreTest, SimpleCloneTest) { al.append(a); final.append(a); t.write(cid, hoid, pl.length() + z.length(), a.length(), al); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist rl; ASSERT_EQ((int)final.length(), @@ -2811,7 +2811,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); } { bufferlist final; @@ -2832,7 +2832,7 @@ TEST_P(StoreTest, SimpleCloneTest) { al.append(a); final.append(a); t.write(cid, hoid, 17000, a.length(), al); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); bufferlist rl; ASSERT_EQ((int)final.length(), store->read(ch, hoid, 0, final.length(), rl)); @@ -2846,7 +2846,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); } { bufferptr p(1048576); @@ -2861,7 +2861,7 @@ TEST_P(StoreTest, SimpleCloneTest) { bufferlist al; al.append(a); t.write(cid, hoid, a.length(), a.length(), al); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); bufferlist rl; bufferlist final; final.substr_of(pl, 0, al.length()); @@ -2881,7 +2881,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); } { bufferptr p(65536); @@ -2896,7 +2896,7 @@ TEST_P(StoreTest, SimpleCloneTest) { bufferlist al; al.append(a); t.write(cid, hoid, 32768, a.length(), al); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); bufferlist rl; bufferlist final; final.substr_of(pl, 0, 32768); @@ -2916,7 +2916,7 @@ TEST_P(StoreTest, SimpleCloneTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove(cid, hoid2); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); } { bufferptr p(65536); @@ -2931,7 +2931,7 @@ TEST_P(StoreTest, SimpleCloneTest) { bufferlist al; al.append(a); t.write(cid, hoid, 33768, a.length(), al); - ASSERT_EQ(0, apply_transaction(store, ch, std::move(t))); + ASSERT_EQ(0, queue_transaction(store, ch, std::move(t))); bufferlist rl; bufferlist final; final.substr_of(pl, 0, 33768); @@ -2967,12 +2967,12 @@ TEST_P(StoreTest, SimpleCloneTest) { t.remove_collection(cid); cerr << "Invalid rm coll" << std::endl; PrCtl unset_dumpable; - EXPECT_DEATH(apply_transaction(store, ch, std::move(t)), ""); + EXPECT_DEATH(queue_transaction(store, ch, std::move(t)), ""); } { ObjectStore::Transaction t; t.touch(cid, hoid3); //new record in db - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } //See comment above for "filestore" check explanation. @@ -2991,7 +2991,7 @@ TEST_P(StoreTest, SimpleCloneTest) { t.remove(cid, hoid2); t.remove_collection(cid); PrCtl unset_dumpable; - EXPECT_DEATH(apply_transaction(store, ch, std::move(t)), ""); + EXPECT_DEATH(queue_transaction(store, ch, std::move(t)), ""); } { ObjectStore::Transaction t; @@ -3000,7 +3000,7 @@ TEST_P(StoreTest, SimpleCloneTest) { t.remove(cid, hoid3); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -3013,7 +3013,7 @@ TEST_P(StoreTest, OmapSimple) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ghobject_t hoid(hobject_t(sobject_t("omap_obj", CEPH_NOSNAP), @@ -3031,7 +3031,7 @@ TEST_P(StoreTest, OmapSimple) { t.omap_setkeys(cid, hoid, km); t.omap_setheader(cid, hoid, header); cerr << "Creating object and set omap " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } // get header, keys @@ -3068,7 +3068,7 @@ TEST_P(StoreTest, OmapSimple) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -3081,7 +3081,7 @@ TEST_P(StoreTest, OmapCloneTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ghobject_t hoid(hobject_t(sobject_t("Object 1", CEPH_NOSNAP), @@ -3099,7 +3099,7 @@ TEST_P(StoreTest, OmapCloneTest) { t.omap_setkeys(cid, hoid, km); t.omap_setheader(cid, hoid, header); cerr << "Creating object and set omap " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ghobject_t hoid2(hobject_t(sobject_t("Object 2", CEPH_NOSNAP), @@ -3108,7 +3108,7 @@ TEST_P(StoreTest, OmapCloneTest) { ObjectStore::Transaction t; t.clone(cid, hoid, hoid2); cerr << "Clone object" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -3124,7 +3124,7 @@ TEST_P(StoreTest, OmapCloneTest) { t.remove(cid, hoid2); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -3137,7 +3137,7 @@ TEST_P(StoreTest, SimpleCloneRangeTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ghobject_t hoid(hobject_t(sobject_t("Object 1", CEPH_NOSNAP))); @@ -3148,7 +3148,7 @@ TEST_P(StoreTest, SimpleCloneRangeTest) { ObjectStore::Transaction t; t.write(cid, hoid, 10, 5, small); cerr << "Creating object and write bl " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ghobject_t hoid2(hobject_t(sobject_t("Object 2", CEPH_NOSNAP))); @@ -3157,7 +3157,7 @@ TEST_P(StoreTest, SimpleCloneRangeTest) { ObjectStore::Transaction t; t.clone_range(cid, hoid, hoid2, 10, 5, 10); cerr << "Clone range object" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); r = store->read(ch, hoid2, 10, 5, newdata); ASSERT_EQ(r, 5); @@ -3168,7 +3168,7 @@ TEST_P(StoreTest, SimpleCloneRangeTest) { t.truncate(cid, hoid, 1024*1024); t.clone_range(cid, hoid, hoid2, 0, 1024*1024, 0); cerr << "Clone range object" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); struct stat stat, stat2; r = store->stat(ch, hoid, &stat); @@ -3182,7 +3182,7 @@ TEST_P(StoreTest, SimpleCloneRangeTest) { t.remove(cid, hoid2); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -3196,7 +3196,7 @@ TEST_P(StoreTest, SimpleObjectLongnameTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ghobject_t hoid(hobject_t(sobject_t("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaObjectaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1", CEPH_NOSNAP))); @@ -3204,7 +3204,7 @@ TEST_P(StoreTest, SimpleObjectLongnameTest) { ObjectStore::Transaction t; t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -3212,7 +3212,7 @@ TEST_P(StoreTest, SimpleObjectLongnameTest) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -3235,7 +3235,7 @@ TEST_P(StoreTest, LongnameSplitTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(0, r); } for (unsigned i = 0; i < 320; ++i) { @@ -3243,7 +3243,7 @@ TEST_P(StoreTest, LongnameSplitTest) { ghobject_t hoid = generate_long_name(i); t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(0, r); } @@ -3256,7 +3256,7 @@ TEST_P(StoreTest, LongnameSplitTest) { t.collection_move_rename( cid, test_obj, cid, test_obj_2); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(0, r); } @@ -3265,7 +3265,7 @@ TEST_P(StoreTest, LongnameSplitTest) { ghobject_t hoid = generate_long_name(i); t.remove(cid, hoid); cerr << "Removing object " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(0, r); } { @@ -3273,7 +3273,7 @@ TEST_P(StoreTest, LongnameSplitTest) { t.remove(cid, test_obj_2); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(0, r); } @@ -3290,7 +3290,7 @@ TEST_P(StoreTest, ManyObjectTest) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } for (int i = 0; i < NUM_OBJS; ++i) { @@ -3303,7 +3303,7 @@ TEST_P(StoreTest, ManyObjectTest) { ghobject_t hoid(hobject_t(sobject_t(string(buf) + base, CEPH_NOSNAP))); t.touch(cid, hoid); created.insert(hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -3376,14 +3376,14 @@ TEST_P(StoreTest, ManyObjectTest) { ++i) { ObjectStore::Transaction t; t.remove(cid, *i); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } cerr << "cleaning up" << std::endl; { ObjectStore::Transaction t; t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -3568,7 +3568,7 @@ public: ObjectStore::Transaction t; ch = store->create_new_collection(cid); t.create_collection(cid, 0); - return apply_transaction(store, ch, std::move(t)); + return queue_transaction(store, ch, std::move(t)); } void shutdown() { while (1) { @@ -3583,11 +3583,11 @@ public: p != objects.end(); ++p) { t.remove(cid, *p); } - apply_transaction(store, ch, std::move(t)); + queue_transaction(store, ch, std::move(t)); } ObjectStore::Transaction t; t.remove_collection(cid); - apply_transaction(store, ch, std::move(t)); + queue_transaction(store, ch, std::move(t)); } void statfs(store_statfs_t& stat) { store->statfs(&stat); @@ -4389,7 +4389,7 @@ TEST_P(StoreTestSpecificAUSize, ZipperPatternSharded) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist bl; @@ -4400,13 +4400,13 @@ TEST_P(StoreTestSpecificAUSize, ZipperPatternSharded) { for (int i=0; i<1000; ++i) { ObjectStore::Transaction t; t.write(cid, a, i*2*len, len, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } for (int i=0; i<1000; ++i) { ObjectStore::Transaction t; t.write(cid, a, i*2*len + 1, len, bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -4414,7 +4414,7 @@ TEST_P(StoreTestSpecificAUSize, ZipperPatternSharded) { t.remove(cid, a); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -4575,7 +4575,7 @@ TEST_P(StoreTest, HashCollisionTest) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } string base = ""; @@ -4594,7 +4594,7 @@ TEST_P(StoreTest, HashCollisionTest) { { ObjectStore::Transaction t; t.touch(cid, hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } created.insert(hoid); @@ -4641,12 +4641,12 @@ TEST_P(StoreTest, HashCollisionTest) { ++i) { ObjectStore::Transaction t; t.remove(cid, *i); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ObjectStore::Transaction t; t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -4658,7 +4658,7 @@ TEST_P(StoreTest, ScrubTest) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } string base = "aaaaa"; @@ -4675,7 +4675,7 @@ TEST_P(StoreTest, ScrubTest) { { ObjectStore::Transaction t; t.touch(cid, hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } created.insert(hoid); @@ -4691,7 +4691,7 @@ TEST_P(StoreTest, ScrubTest) { t.touch(cid, hoid1); t.touch(cid, hoid2); t.touch(cid, hoid3); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); created.insert(hoid1); created.insert(hoid2); created.insert(hoid3); @@ -4739,12 +4739,12 @@ TEST_P(StoreTest, ScrubTest) { ++i) { ObjectStore::Transaction t; t.remove(cid, *i); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ObjectStore::Transaction t; t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -4757,7 +4757,7 @@ TEST_P(StoreTest, OMapTest) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -4768,7 +4768,7 @@ TEST_P(StoreTest, OMapTest) { t.omap_clear(cid, hoid); map start_set; t.omap_setkeys(cid, hoid, start_set); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -4804,7 +4804,7 @@ TEST_P(StoreTest, OMapTest) { to_add.insert(pair("key-" + string(buf), bl)); attrs.insert(pair("key-" + string(buf), bl)); t.omap_setkeys(cid, hoid, to_add); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -4835,7 +4835,7 @@ TEST_P(StoreTest, OMapTest) { set keys_to_remove; keys_to_remove.insert(to_remove); t.omap_rmkeys(cid, hoid, keys_to_remove); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); attrs.erase(to_remove); @@ -4848,7 +4848,7 @@ TEST_P(StoreTest, OMapTest) { bl1.append("omap_header"); ObjectStore::Transaction t; t.omap_setheader(cid, hoid, bl1); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); t = ObjectStore::Transaction(); @@ -4857,7 +4857,7 @@ TEST_P(StoreTest, OMapTest) { map to_add; to_add.insert(pair("key", bl2)); t.omap_setkeys(cid, hoid, to_add); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bufferlist bl3; @@ -4887,13 +4887,13 @@ TEST_P(StoreTest, OMapTest) { t.touch(cid, hoid); t.omap_setheader(cid, hoid, h); t.omap_setkeys(cid, hoid, to_set); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.omap_rmkeyrange(cid, hoid, "3", "7"); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -4912,7 +4912,7 @@ TEST_P(StoreTest, OMapTest) { { ObjectStore::Transaction t; t.omap_clear(cid, hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -4927,7 +4927,7 @@ TEST_P(StoreTest, OMapTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -4940,7 +4940,7 @@ TEST_P(StoreTest, OMapIterator) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -4951,7 +4951,7 @@ TEST_P(StoreTest, OMapIterator) { t.omap_clear(cid, hoid); map start_set; t.omap_setkeys(cid, hoid, start_set); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ObjectMap::ObjectMapIterator iter; @@ -4982,7 +4982,7 @@ TEST_P(StoreTest, OMapIterator) { } ASSERT_EQ((int)attrs.size(), count); - // FileStore may deadlock an active iterator vs apply_transaction + // FileStore may deadlock an active iterator vs queue_transaction iter = ObjectMap::ObjectMapIterator(); char buf[100]; @@ -4995,7 +4995,7 @@ TEST_P(StoreTest, OMapIterator) { attrs.insert(pair("key-" + string(buf), bl)); ObjectStore::Transaction t; t.omap_setkeys(cid, hoid, to_add); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5016,13 +5016,13 @@ TEST_P(StoreTest, OMapIterator) { } ASSERT_EQ(correct, true); - // FileStore may deadlock an active iterator vs apply_transaction + // FileStore may deadlock an active iterator vs queue_transaction iter = ObjectMap::ObjectMapIterator(); { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -5044,7 +5044,7 @@ TEST_P(StoreTest, XattrTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); t.touch(cid, hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5063,7 +5063,7 @@ TEST_P(StoreTest, XattrTest) { attrs["attr4"] = big; t.setattr(cid, hoid, "attr3", big); attrs["attr3"] = big; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5082,7 +5082,7 @@ TEST_P(StoreTest, XattrTest) { ObjectStore::Transaction t; t.rmattr(cid, hoid, "attr2"); attrs.erase("attr2"); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5110,7 +5110,7 @@ TEST_P(StoreTest, XattrTest) { ObjectStore::Transaction t; t.remove(cid, hoid); t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5128,7 +5128,7 @@ void colsplittest( { ObjectStore::Transaction t; t.create_collection(cid, common_suffix_size); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } bufferlist small; @@ -5157,19 +5157,19 @@ void colsplittest( t.clone(cid, a, b); } if (i % 100) { - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); t = ObjectStore::Transaction(); } } - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.create_collection(tid, common_suffix_size + 1); t.split_collection(cid, common_suffix_size+1, 1< 100) { size = 0; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); t = ObjectStore::Transaction(); } @@ -5205,7 +5205,7 @@ void colsplittest( t.remove(tid, *i); if (++size > 100) { size = 0; - r = apply_transaction(store, tch, std::move(t)); + r = queue_transaction(store, tch, std::move(t)); ASSERT_EQ(r, 0); t = ObjectStore::Transaction(); } @@ -5213,7 +5213,7 @@ void colsplittest( t.remove_collection(cid); t.remove_collection(tid); - r = apply_transaction(store, tch, std::move(t)); + r = queue_transaction(store, tch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5250,7 +5250,7 @@ TEST_P(StoreTest, TwoHash) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } std::cout << "Making objects" << std::endl; @@ -5264,7 +5264,7 @@ TEST_P(StoreTest, TwoHash) { } o.hobj.set_hash((i << 16) | 0xB1); t.touch(cid, o); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } std::cout << "Removing half" << std::endl; @@ -5274,7 +5274,7 @@ TEST_P(StoreTest, TwoHash) { o.hobj.pool = -1; o.hobj.set_hash((i << 16) | 0xA1); t.remove(cid, o); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } std::cout << "Checking" << std::endl; @@ -5302,12 +5302,12 @@ TEST_P(StoreTest, TwoHash) { t.remove(cid, o); o.hobj.set_hash((i << 16) | 0xB1); t.remove(cid, o); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ObjectStore::Transaction t; t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5324,7 +5324,7 @@ TEST_P(StoreTest, Rename) { ObjectStore::Transaction t; t.create_collection(cid, 0); t.write(cid, srcoid, 0, a.length(), a); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_TRUE(store->exists(ch, srcoid)); @@ -5333,7 +5333,7 @@ TEST_P(StoreTest, Rename) { t.collection_move_rename(cid, srcoid, cid, dstoid); t.write(cid, srcoid, 0, b.length(), b); t.setattr(cid, srcoid, "attr", b); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_TRUE(store->exists(ch, srcoid)); @@ -5349,7 +5349,7 @@ TEST_P(StoreTest, Rename) { ObjectStore::Transaction t; t.remove(cid, dstoid); t.collection_move_rename(cid, srcoid, cid, dstoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_TRUE(store->exists(ch, dstoid)); @@ -5363,7 +5363,7 @@ TEST_P(StoreTest, Rename) { ObjectStore::Transaction t; t.remove(cid, dstoid); t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -5378,7 +5378,7 @@ TEST_P(StoreTest, MoveRename) { ObjectStore::Transaction t; t.create_collection(cid, 0); t.touch(cid, oid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_TRUE(store->exists(ch, oid)); @@ -5393,7 +5393,7 @@ TEST_P(StoreTest, MoveRename) { t.write(cid, temp_oid, 0, data.length(), data); t.setattr(cid, temp_oid, "attr", attr); t.omap_setkeys(cid, temp_oid, omap); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_TRUE(store->exists(ch, temp_oid)); @@ -5401,7 +5401,7 @@ TEST_P(StoreTest, MoveRename) { ObjectStore::Transaction t; t.remove(cid, oid); t.collection_move_rename(cid, temp_oid, cid, oid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } ASSERT_TRUE(store->exists(ch, oid)); @@ -5428,7 +5428,7 @@ TEST_P(StoreTest, MoveRename) { ObjectStore::Transaction t; t.remove(cid, oid); t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -5460,14 +5460,14 @@ TEST_P(StoreTest, BigRGWObjectName) { t.collection_move_rename(cid, oidhead, cid, oid); t.touch(cid, oidhead); t.collection_move_rename(cid, oidhead, cid, oid2); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.remove(cid, oid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5486,7 +5486,7 @@ TEST_P(StoreTest, BigRGWObjectName) { ObjectStore::Transaction t; t.remove(cid, oid2); t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5501,31 +5501,31 @@ TEST_P(StoreTest, SetAllocHint) { ObjectStore::Transaction t; t.create_collection(cid, 0); t.touch(cid, hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*4, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.remove(cid, hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*4, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.remove_collection(cid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -5539,25 +5539,25 @@ TEST_P(StoreTest, TryMoveRename) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.try_rename(cid, hoid, hoid2); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.touch(cid, hoid); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { ObjectStore::Transaction t; t.try_rename(cid, hoid, hoid2); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } struct stat st; @@ -5584,7 +5584,7 @@ TEST_P(StoreTest, BluestoreOnOffCSumTest) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -5598,7 +5598,7 @@ TEST_P(StoreTest, BluestoreOnOffCSumTest) { t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*8, 0); t.write(cid, hoid, 0, bl.length(), bl); cerr << "Remove then create" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); g_conf->set_val("bluestore_csum_type", "none"); @@ -5622,7 +5622,7 @@ TEST_P(StoreTest, BluestoreOnOffCSumTest) { t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*8, 0); t.write(cid, hoid, 0, bl.length(), bl); cerr << "Remove then create" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); g_conf->set_val("bluestore_csum_type", "crc32c"); @@ -5644,7 +5644,7 @@ TEST_P(StoreTest, BluestoreOnOffCSumTest) { t.remove(cid, hoid); t.write(cid, hoid, 0, bl.length(), bl); cerr << "Remove then create" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); g_conf->set_val("bluestore_csum_type", "none"); @@ -5653,7 +5653,7 @@ TEST_P(StoreTest, BluestoreOnOffCSumTest) { ObjectStore::Transaction t2; t2.write(cid, hoid, block_size*2, bl.length(), bl); cerr << "Append 'unprotected'" << std::endl; - r = apply_transaction(store, ch, std::move(t2)); + r = queue_transaction(store, ch, std::move(t2)); ASSERT_EQ(r, 0); bufferlist in; @@ -5689,7 +5689,7 @@ TEST_P(StoreTest, BluestoreOnOffCSumTest) { t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*8, 0); t.write(cid, hoid, 0, bl.length(), bl); cerr << "Remove then create" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); g_conf->set_val("bluestore_csum_type", "none"); @@ -5701,7 +5701,7 @@ TEST_P(StoreTest, BluestoreOnOffCSumTest) { t2.write(cid, hoid, 0, bl.length(), bl); t2.write(cid, hoid, block_size0, bl.length(), bl); cerr << "Overwrite with unprotected data" << std::endl; - r = apply_transaction(store, ch, std::move(t2)); + r = queue_transaction(store, ch, std::move(t2)); ASSERT_EQ(r, 0); orig = bl; @@ -5725,7 +5725,7 @@ TEST_P(StoreTest, BluestoreOnOffCSumTest) { bl.append(std::string(block_size2, 'c')); t3.write(cid, hoid, block_size0, bl.length(), bl); cerr << "Overwrite with protected data" << std::endl; - r = apply_transaction(store, ch, std::move(t3)); + r = queue_transaction(store, ch, std::move(t3)); ASSERT_EQ(r, 0); in.clear(); @@ -5741,7 +5741,7 @@ TEST_P(StoreTest, BluestoreOnOffCSumTest) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } @@ -5900,7 +5900,7 @@ TEST_P(StoreTestSpecificAUSize, OnodeSizeTracking) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -5909,7 +5909,7 @@ TEST_P(StoreTestSpecificAUSize, OnodeSizeTracking) { bl.append(std::string(obj_size, 'a')); t.write(cid, hoid, 0, bl.length(), bl); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } get_mempool_stats(&total_bytes, &total_onodes); @@ -5919,7 +5919,7 @@ TEST_P(StoreTestSpecificAUSize, OnodeSizeTracking) { { ObjectStore::Transaction t; t.truncate(cid, hoid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -5929,7 +5929,7 @@ TEST_P(StoreTestSpecificAUSize, OnodeSizeTracking) { for( size_t j = 0; j < obj_size; j+= bl.length()) { ObjectStore::Transaction t; t.write(cid, hoid, j, bl.length(), bl); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } get_mempool_stats(&total_bytes2, &total_onodes); @@ -5969,7 +5969,7 @@ TEST_P(StoreTestSpecificAUSize, OnodeSizeTracking) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } g_ceph_context->_conf->set_val("bluestore_cache_size_hdd", "4000000"); @@ -5999,7 +5999,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwrite) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6008,7 +6008,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwrite) { bl.append(std::string(block_size * 2, 'a')); t.write(cid, hoid, 0, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6018,7 +6018,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwrite) { bl.append(std::string(block_size, 'b')); t.write(cid, hoid, 0, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6028,7 +6028,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwrite) { bl.append(std::string(block_size * 2, 'c')); t.write(cid, hoid, block_size * 2, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6038,7 +6038,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwrite) { bl.append(std::string(block_size * 2, 'd')); t.write(cid, hoid, block_size * 5, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6063,7 +6063,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwrite) { // Currently we are unable to reuse blob when overwriting in a single step t.write(cid, hoid, block_size * 6, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6087,7 +6087,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwrite) { bl.append(std::string(block_size, 'f')); t.write(cid, hoid, block_size * 4, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6147,7 +6147,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwrite) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } g_conf->set_val("bluestore_max_blob_size", "0"); @@ -6175,7 +6175,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwriteReverse) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6185,7 +6185,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwriteReverse) { bl.append(std::string(block_size * 2, 'a')); t.write(cid, hoid, block_size * 10, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6196,7 +6196,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwriteReverse) { bl.append(std::string(block_size, 'b')); t.write(cid, hoid, block_size * 9, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6223,7 +6223,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwriteReverse) { bl.append(std::string(block_size, 'c')); t.write(cid, hoid, block_size * 7, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6250,7 +6250,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwriteReverse) { bl.append(std::string(block_size, 'd')); t.write(cid, hoid, block_size * 13, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6279,7 +6279,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwriteReverse) { CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); t.write(cid, hoid, block_size * 19, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6307,7 +6307,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwriteReverse) { CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); t.write(cid, hoid, block_size * 18, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6331,7 +6331,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnOverwriteReverse) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } g_conf->set_val("bluestore_max_blob_size", "0"); @@ -6357,7 +6357,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnSmallOverwrite) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6368,7 +6368,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnSmallOverwrite) { t.write(cid, hoid, 0, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); t.write(cid, hoid, block_size * 2, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6379,7 +6379,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnSmallOverwrite) { bl.append(std::string(3, 'b')); t.write(cid, hoid, block_size + 1, bl.length(), bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6405,7 +6405,7 @@ TEST_P(StoreTestSpecificAUSize, BlobReuseOnSmallOverwrite) { t.remove(cid, hoid); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } g_conf->set_val("bluestore_max_blob_size", "0"); @@ -6437,7 +6437,7 @@ TEST_P(StoreTestSpecificAUSize, SmallWriteOnShardedExtents) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6448,13 +6448,13 @@ TEST_P(StoreTestSpecificAUSize, SmallWriteOnShardedExtents) { bl.append(std::string(0x80000, 'a')); t.write(cid, hoid1, 0, bl.length(), bl, 0); t.zero(cid, hoid1, 0x719e0, 0x75b0 ); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); bl2.append(std::string(0x70000, 'b')); t.write(cid, hoid1, 0, bl2.length(), bl2, 0); t.zero(cid, hoid1, 0, 0x50000); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -6471,7 +6471,7 @@ TEST_P(StoreTestSpecificAUSize, SmallWriteOnShardedExtents) { bl.append(std::string(0x6520, 'c')); t.write(cid, hoid1, 0x71c00, bl.length(), bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -6496,7 +6496,7 @@ TEST_P(StoreTestSpecificAUSize, SmallWriteOnShardedExtents) { t.remove(cid, hoid1); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } g_conf->set_val("bluestore_max_target_blob", "524288"); @@ -6525,7 +6525,7 @@ TEST_P(StoreTestSpecificAUSize, ExcessiveFragmentation) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6538,7 +6538,7 @@ TEST_P(StoreTestSpecificAUSize, ExcessiveFragmentation) { while(offs < (uint64_t)400 * 1024 * 1024) { t.write(cid, hoid1, offs, bl.length(), bl, 0); t.write(cid, hoid2, offs, bl.length(), bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); offs += bl.length(); if( (offs % (100 * 1024 * 1024)) == 0) { @@ -6560,7 +6560,7 @@ TEST_P(StoreTestSpecificAUSize, ExcessiveFragmentation) { while(offs < 112 * 1024 * 1024) { t.write(cid, hoid1, offs, bl.length(), bl, 0); t.write(cid, hoid2, offs, bl.length(), bl, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); // this will produce high fragmentation if original allocations // were contiguous @@ -6576,7 +6576,7 @@ TEST_P(StoreTestSpecificAUSize, ExcessiveFragmentation) { // Which should fail as there is no long enough pextents. ObjectStore::Transaction t; t.remove(cid, hoid2); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -6589,7 +6589,7 @@ TEST_P(StoreTestSpecificAUSize, ExcessiveFragmentation) { // touch another object to triggerrebalance ObjectStore::Transaction t; t.touch(cid, hoid1); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } { @@ -6598,7 +6598,7 @@ TEST_P(StoreTestSpecificAUSize, ExcessiveFragmentation) { t.remove(cid, hoid2); t.remove_collection(cid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } g_conf->set_val("bluestore_block_size", @@ -6623,7 +6623,7 @@ TEST_P(StoreTest, KVDBHistogramTest) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } for (int i = 0; i < NUM_OBJS; ++i) { @@ -6632,7 +6632,7 @@ TEST_P(StoreTest, KVDBHistogramTest) { snprintf(buf, sizeof(buf), "%d", i); ghobject_t hoid(hobject_t(sobject_t(base + string(buf), CEPH_NOSNAP))); t.write(cid, hoid, 0, 0x1000, a); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -6667,7 +6667,7 @@ TEST_P(StoreTest, KVDBStatsTest) { { ObjectStore::Transaction t; t.create_collection(cid, 0); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } for (int i = 0; i < NUM_OBJS; ++i) { @@ -6676,7 +6676,7 @@ TEST_P(StoreTest, KVDBStatsTest) { snprintf(buf, sizeof(buf), "%d", i); ghobject_t hoid(hobject_t(sobject_t(base + string(buf), CEPH_NOSNAP))); t.write(cid, hoid, 0, 0x1000, a); - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -6710,7 +6710,7 @@ TEST_P(StoreTestSpecificAUSize, garbageCollection) { } else {\ t.write(cid, hoid, offset, bl.length(), bl);\ }\ - r = apply_transaction(store, ch, std::move(t));\ + r = queue_transaction(store, ch, std::move(t));\ ASSERT_EQ(r, 0);\ } @@ -6733,7 +6733,7 @@ TEST_P(StoreTestSpecificAUSize, garbageCollection) { ObjectStore::Transaction t; t.create_collection(cid, 0); cerr << "Creating collection " << cid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } @@ -6748,7 +6748,7 @@ TEST_P(StoreTestSpecificAUSize, garbageCollection) { ObjectStore::Transaction t; t.touch(cid, hoid); cerr << "Creating object " << hoid << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); exists = store->exists(ch, hoid); @@ -6847,7 +6847,7 @@ TEST_P(StoreTestSpecificAUSize, garbageCollection) { ObjectStore::Transaction t; t.remove(cid, hoid); cerr << "Cleaning" << std::endl; - r = apply_transaction(store, ch, std::move(t)); + r = queue_transaction(store, ch, std::move(t)); ASSERT_EQ(r, 0); } } diff --git a/src/test/objectstore/test_idempotent.cc b/src/test/objectstore/test_idempotent.cc index 33a00c4338b4e..2b256930e0f08 100644 --- a/src/test/objectstore/test_idempotent.cc +++ b/src/test/objectstore/test_idempotent.cc @@ -79,7 +79,7 @@ int main(int argc, char **argv) { assert(!store->mount()); ch = store->create_new_collection(coll); t.create_collection(coll, 0); - store->apply_transaction(ch, std::move(t)); + store->queue_transaction(ch, std::move(t), nullptr); } else { assert(!store->mount()); ch = store->open_collection(coll); diff --git a/src/test/objectstore/test_memstore_clone.cc b/src/test/objectstore/test_memstore_clone.cc index 3b24807b831bc..bb20ab2af27ca 100644 --- a/src/test/objectstore/test_memstore_clone.cc +++ b/src/test/objectstore/test_memstore_clone.cc @@ -46,7 +46,7 @@ public: ObjectStore::Transaction t; ch = store->create_new_collection(cid); t.create_collection(cid, 4); - unsigned r = store->apply_transaction(ch, std::move(t)); + unsigned r = store->queue_transaction(ch, std::move(t), nullptr); if (r != 0) { derr << "failed to create collection with " << cpp_strerror(r) << dendl; } @@ -77,7 +77,7 @@ TEST_F(MemStoreClone, CloneRangeAllocated) 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->apply_transaction(ch, std::move(t))); + ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr)); ASSERT_EQ(12, store->read(ch, dst, 0, 12, result)); ASSERT_EQ(expected, result); } @@ -101,7 +101,7 @@ TEST_F(MemStoreClone, CloneRangeHole) 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->apply_transaction(ch, std::move(t))); + ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr)); ASSERT_EQ(12, store->read(ch, dst, 0, 12, result)); ASSERT_EQ(expected, result); } @@ -125,7 +125,7 @@ TEST_F(MemStoreClone, CloneRangeHoleStart) 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->apply_transaction(ch, std::move(t))); + ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr)); ASSERT_EQ(12, store->read(ch, dst, 0, 12, result)); ASSERT_EQ(expected, result); } @@ -150,7 +150,7 @@ TEST_F(MemStoreClone, CloneRangeHoleMiddle) 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->apply_transaction(ch, std::move(t))); + ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr)); ASSERT_EQ(12, store->read(ch, dst, 0, 12, result)); ASSERT_EQ(expected, result); } @@ -175,7 +175,7 @@ TEST_F(MemStoreClone, CloneRangeHoleEnd) 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->apply_transaction(ch, std::move(t))); + ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr)); ASSERT_EQ(12, store->read(ch, dst, 0, 12, result)); ASSERT_EQ(expected, result); } diff --git a/src/test/objectstore_bench.cc b/src/test/objectstore_bench.cc index 2524a3c41fdc3..a1f2feee99bc9 100644 --- a/src/test/objectstore_bench.cc +++ b/src/test/objectstore_bench.cc @@ -259,7 +259,7 @@ int main(int argc, const char *argv[]) { ObjectStore::Transaction t; t.create_collection(cid, 0); - os->apply_transaction(ch, std::move(t)); + os->queue_transaction(ch, std::move(t), nullptr); } // create the objects @@ -273,7 +273,7 @@ int main(int argc, const char *argv[]) ObjectStore::Transaction t; t.touch(cid, oids[i]); - int r = os->apply_transaction(ch, std::move(t)); + int r = os->queue_transaction(ch, std::move(t), nullptr); assert(r == 0); } } else { @@ -281,7 +281,7 @@ int main(int argc, const char *argv[]) ObjectStore::Transaction t; t.touch(cid, oids.back()); - int r = os->apply_transaction(ch, std::move(t)); + int r = os->queue_transaction(ch, std::move(t), nullptr); assert(r == 0); } @@ -313,7 +313,7 @@ int main(int argc, const char *argv[]) ObjectStore::Transaction t; for (const auto &oid : oids) t.remove(cid, oid); - os->apply_transaction(ch, std::move(t)); + os->queue_transaction(ch, std::move(t), nullptr); os->umount(); return 0; diff --git a/src/test/osd/TestPGLog.cc b/src/test/osd/TestPGLog.cc index e66b8f09367d3..1aa64f4cdb6ff 100644 --- a/src/test/osd/TestPGLog.cc +++ b/src/test/osd/TestPGLog.cc @@ -2321,7 +2321,7 @@ public: test_coll = coll_t(spg_t(pg_t(1, 1))); ch = store->create_new_collection(test_coll); t.create_collection(test_coll, 0); - store->apply_transaction(ch, std::move(t)); + store->queue_transaction(ch, std::move(t), nullptr); existing_oid = mk_obj(0); nonexistent_oid = mk_obj(1); ghobject_t existing_ghobj(existing_oid); @@ -2332,7 +2332,7 @@ public: 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->apply_transaction(ch, std::move(t2))); + ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t2), nullptr)); info.last_backfill = hobject_t::get_max(); info.last_complete = eversion_t(); } @@ -2404,7 +2404,7 @@ public: 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->apply_transaction(ch, std::move(t)); + store->queue_transaction(ch, std::move(t), nullptr); } void TearDown() override { @@ -2490,7 +2490,7 @@ public: t.omap_setkeys(test_coll, log_oid, km); } auto ch = store->open_collection(test_coll); - ASSERT_EQ(0u, store->apply_transaction(ch, std::move(t))); + ASSERT_EQ(0u, store->queue_transaction(ch, std::move(t), nullptr)); auto orig_dups = log.dups; clear(); diff --git a/src/test/test_trans.cc b/src/test/test_trans.cc index 18a85e7e25c31..9b161e180f60c 100644 --- a/src/test/test_trans.cc +++ b/src/test/test_trans.cc @@ -74,7 +74,6 @@ int main(int argc, const char **argv) dout(0) << "starting thread" << dendl; foo.create("foo"); dout(0) << "starting op" << dendl; - fs->apply_transaction(ch, std::move(t)); - + fs->queue_transaction(ch, std::move(t), nullptr); } diff --git a/src/test/xattr_bench.cc b/src/test/xattr_bench.cc index 4e5f1a79253d4..ff3e6ada66ebe 100644 --- a/src/test/xattr_bench.cc +++ b/src/test/xattr_bench.cc @@ -106,7 +106,7 @@ uint64_t do_run(ObjectStore *store, int attrsize, int numattrs, } collections[coll] = make_pair(objects, new ObjectStore::Sequencer(coll.to_str())); } - store->apply_transaction(&osr, std::move(t)); + store->queue_transaction(&osr, std::move(t)); bufferlist bl; for (int i = 0; i < attrsize; ++i) { diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 9f1fd3a12418a..048350cc552cf 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -431,7 +431,7 @@ int initiate_new_remove_pg(ObjectStore *store, spg_t r_pgid) return r; } ObjectStore::CollectionHandle ch = store->open_collection(coll_t(r_pgid)); - store->apply_transaction(ch, std::move(rmt)); + store->queue_transaction(ch, std::move(rmt), nullptr); finish_remove_pgs(store); return r; } @@ -668,7 +668,7 @@ int set_inc_osdmap(ObjectStore *store, epoch_t e, bufferlist& bl, bool force) { 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->apply_transaction(ch, std::move(t)); + int ret = store->queue_transaction(ch, std::move(t), nullptr); if (ret) { cerr << "Failed to set inc-osdmap (" << inc_oid << "): " << ret << std::endl; } else { @@ -716,7 +716,7 @@ int set_osdmap(ObjectStore *store, epoch_t e, bufferlist& bl, bool force) { 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->apply_transaction(ch, std::move(t)); + int ret = store->queue_transaction(ch, std::move(t), nullptr); if (ret) { cerr << "Failed to set osdmap (" << full_oid << "): " << ret << std::endl; } else { @@ -1170,7 +1170,7 @@ int ObjectStoreTool::get_object(ObjectStore *store, } } if (!dry_run) - store->apply_transaction(ch, std::move(*t)); + store->queue_transaction(ch, std::move(*t), nullptr); return 0; } @@ -1711,7 +1711,7 @@ int ObjectStoreTool::do_import(ObjectStore *store, OSDSuperblock& sb, encode((char)1, values["_remove"]); t.omap_setkeys(coll, pgid.make_pgmeta_oid(), values); - store->apply_transaction(ch, std::move(t)); + store->queue_transaction(ch, std::move(t), nullptr); } cout << "Importing pgid " << pgid; @@ -1829,7 +1829,7 @@ int ObjectStoreTool::do_import(ObjectStore *store, OSDSuperblock& sb, set remove; remove.insert("_remove"); t.omap_rmkeys(coll, pgid.make_pgmeta_oid(), remove); - store->apply_transaction(ch, std::move(t)); + store->queue_transaction(ch, std::move(t), nullptr); } return 0; @@ -1945,7 +1945,7 @@ int do_remove_object(ObjectStore *store, coll_t coll, } if (!dry_run) - store->apply_transaction(ch, std::move(t)); + store->queue_transaction(ch, std::move(t), nullptr); return 0; } @@ -2071,12 +2071,12 @@ int do_set_bytes(ObjectStore *store, coll_t coll, t->write(coll, ghobj, offset, bytes, rawdatabl); offset += bytes; - // XXX: Should we apply_transaction() every once in a while for very large files + // XXX: Should we queue_transaction() every once in a while for very large files } while(true); auto ch = store->open_collection(coll); if (!dry_run) - store->apply_transaction(ch, std::move(*t)); + store->queue_transaction(ch, std::move(*t), nullptr); return 0; } @@ -2123,7 +2123,7 @@ int do_set_attr(ObjectStore *store, coll_t coll, t->setattr(coll, ghobj, key, bl); auto ch = store->open_collection(coll); - store->apply_transaction(ch, std::move(*t)); + store->queue_transaction(ch, std::move(*t), nullptr); return 0; } @@ -2142,7 +2142,7 @@ int do_rm_attr(ObjectStore *store, coll_t coll, t->rmattr(coll, ghobj, key); auto ch = store->open_collection(coll); - store->apply_transaction(ch, std::move(*t)); + store->queue_transaction(ch, std::move(*t), nullptr); return 0; } @@ -2203,7 +2203,7 @@ int do_set_omap(ObjectStore *store, coll_t coll, t->omap_setkeys(coll, ghobj, attrset); auto ch = store->open_collection(coll); - store->apply_transaction(ch, std::move(*t)); + store->queue_transaction(ch, std::move(*t), nullptr); return 0; } @@ -2225,7 +2225,7 @@ int do_rm_omap(ObjectStore *store, coll_t coll, t->omap_rmkeys(coll, ghobj, keys); auto ch = store->open_collection(coll); - store->apply_transaction(ch, std::move(*t)); + store->queue_transaction(ch, std::move(*t), nullptr); return 0; } @@ -2272,7 +2272,7 @@ int do_set_omaphdr(ObjectStore *store, coll_t coll, t->omap_setheader(coll, ghobj, hdrbl); auto ch = store->open_collection(coll); - store->apply_transaction(ch, std::move(*t)); + store->queue_transaction(ch, std::move(*t), nullptr); return 0; } @@ -2292,7 +2292,7 @@ struct do_fix_lost : public action_on_object_t { ObjectStore::Transaction t; t.setattr(coll, ghobj, OI_ATTR, bl); auto ch = store->open_collection(coll); - int r = store->apply_transaction(ch, std::move(t)); + int r = store->queue_transaction(ch, std::move(t), nullptr); if (r < 0) { cerr << "Error getting fixing attr on : " << make_pair(coll, ghobj) << ", " @@ -2481,7 +2481,7 @@ int set_size( t.setattr(coll, head, SS_ATTR, snapattr); } auto ch = store->open_collection(coll); - r = store->apply_transaction(ch, std::move(t)); + r = store->queue_transaction(ch, std::move(t), nullptr); if (r < 0) { cerr << "Error writing object info: " << make_pair(coll, ghobj) << ", " << cpp_strerror(r) << std::endl; @@ -2528,7 +2528,7 @@ int clear_snapset(ObjectStore *store, coll_t coll, ghobject_t &ghobj, ObjectStore::Transaction t; t.setattr(coll, ghobj, SS_ATTR, bl); auto ch = store->open_collection(coll); - int r = store->apply_transaction(ch, std::move(t)); + int r = store->queue_transaction(ch, std::move(t), nullptr); if (r < 0) { cerr << "Error setting snapset on : " << make_pair(coll, ghobj) << ", " << cpp_strerror(r) << std::endl; @@ -2627,7 +2627,7 @@ int remove_clone( ObjectStore::Transaction t; t.setattr(coll, ghobj, SS_ATTR, bl); auto ch = store->open_collection(coll); - int r = store->apply_transaction(ch, std::move(t)); + int r = store->queue_transaction(ch, std::move(t), nullptr); if (r < 0) { cerr << "Error setting snapset on : " << make_pair(coll, ghobj) << ", " << cpp_strerror(r) << std::endl; @@ -2702,7 +2702,7 @@ int dup(string srcpath, ObjectStore *src, string dstpath, ObjectStore *dst) } } t.create_collection(cid, bits); - dst->apply_transaction(dch, std::move(t)); + dst->queue_transaction(dch, std::move(t), nullptr); } ghobject_t pos; @@ -2758,7 +2758,7 @@ int dup(string srcpath, ObjectStore *src, string dstpath, ObjectStore *dst) t.omap_setkeys(cid, oid, omap); } - dst->apply_transaction(dch, std::move(t)); + dst->queue_transaction(dch, std::move(t), nullptr); } } cout << " " << std::setw(16) << n << " objects, " @@ -3978,7 +3978,7 @@ int main(int argc, char **argv) if (ret != 0) goto out; auto ch = fs->open_collection(coll_t(pgid)); - fs->apply_transaction(ch, std::move(*t)); + fs->queue_transaction(ch, std::move(*t), nullptr); } cout << "Marking complete succeeded" << std::endl; } else { -- 2.39.5