Project

General

Profile

Bug #38272 ยป no_span_blob.diff

diff to repro the issue - Igor Fedotov, 02/12/2019 03:32 PM

View differences:

src/os/bluestore/BlueStore.cc
{
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;
src/os/bluestore/KernelDevice.cc
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();
src/test/objectstore/store_test.cc
}
}
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) {
    (1-1/1)