diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 82b00f8bad..c07a486793 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -11200,6 +11200,7 @@ int BlueStore::_touch(TransContext *txc, { dout(15) << __func__ << " " << c->cid << " " << o->oid << dendl; int r = 0; + _dump_onode<0>(o); _assign_nid(txc, o); txc->write_onode(o); dout(10) << __func__ << " " << c->cid << " " << o->oid << " = " << r << dendl; diff --git a/src/os/bluestore/KernelDevice.cc b/src/os/bluestore/KernelDevice.cc index df75086f43..af54acaac7 100644 --- a/src/os/bluestore/KernelDevice.cc +++ b/src/os/bluestore/KernelDevice.cc @@ -174,7 +174,7 @@ int KernelDevice::open(const string& p) rotational = true; } else { dout(20) << __func__ << " devname " << devname << dendl; - rotational = blkdev_buffered.is_rotational(); + rotational = true; //blkdev_buffered.is_rotational(); support_discard = blkdev_buffered.support_discard(); this->devname = devname; _detect_vdo(); diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 60450ed794..5156b3de54 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -1313,6 +1313,86 @@ TEST_P(StoreTest, SimpleObjectTest) { } } +TEST_P(StoreTestSpecificAUSize, ReproNoBlobMultiTest) { + + if(string(GetParam()) != "bluestore") + return; + + SetVal(g_conf(), "bluestore_block_db_create", "true"); + SetVal(g_conf(), "bluestore_debug_omit_block_device_write", "true"); + SetVal(g_conf(), "bluestore_block_db_size", "20737418240"); +// SetVal(g_conf(), "bluestore_block_db_path", "/dev/nvme/data"); + SetVal(g_conf(), "bluestore_block_size", "30737418240"); + SetVal(g_conf(), "bluestore_allocator", "stupid"); + SetVal(g_conf(), "bluestore_max_blob_size", "524288"); + + g_conf().apply_changes(nullptr); + + StartDeferred(65536); + + int r; + coll_t cid; + ghobject_t hoid(hobject_t(sobject_t("Object 1", CEPH_NOSNAP))); + ghobject_t hoid2 = hoid; + hoid2.hobj.snap = 1; + + auto ch = store->create_new_collection(cid); + { + ObjectStore::Transaction t; + t.create_collection(cid, 0); + cerr << "Creating collection " << cid << std::endl; + r = queue_transaction(store, ch, std::move(t)); + ASSERT_EQ(r, 0); + } + { + bool exists = store->exists(ch, hoid); + ASSERT_TRUE(!exists); + + ObjectStore::Transaction t; + t.touch(cid, hoid); + cerr << "Creating object " << hoid << std::endl; + r = queue_transaction(store, ch, std::move(t)); + ASSERT_EQ(r, 0); + + exists = store->exists(ch, hoid); + ASSERT_EQ(true, exists); + } + { + uint64_t offs = 0; + bufferlist bl; + const int size = 0x400; + bufferptr ap(size); + memset(ap.c_str(), 'a', size); + bl.append(ap); + int i = 0; + uint64_t blob_size = 524288; + uint64_t total = 0; + for (i = 0; i < 257; i++) { + ObjectStore::Transaction t; + ghobject_t hoid2 = hoid; + hoid2.hobj.snap = ++i; + offs = 0 + i * size; + while (offs < 128 * 1024 * 1024) { + + t.write(cid, hoid, offs, ap.length(), bl); + offs += blob_size; + total += ap.length(); + } + t.clone(cid, hoid, hoid2); + t.touch(cid, hoid); // intended to dump onode only + r = queue_transaction(store, ch, std::move(t)); + ASSERT_EQ(r, 0); + } + cerr << "Total written = " << total << std::endl; + } + { + ObjectStore::Transaction t; + t.touch(cid, hoid); // intended to dump onode only + cerr << "Finalizing" << std::endl; + r = queue_transaction(store, ch, std::move(t)); + ASSERT_EQ(r, 0); + } +} #if defined(WITH_BLUESTORE) TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) {