template <typename T>
-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);
}
}
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();
{
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);
}
{
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();
{
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);
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);
}
}
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
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);
}
}
}
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);
}
}
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();
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);
}
}
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);
}
{
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);
}
}
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);
}
{
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);
}
}
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);
}
{
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);
}
{
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);
}
{
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);
}
}
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);
}
{
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);
}
{
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);
}
{
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);
}
}
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);
}
{
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
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;
{
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;
{
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;
{
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;
{
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;
{
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);
}
{
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);
}
}
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, 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);
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);
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);
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);
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);
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, 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);
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);
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);
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);
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);
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
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
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));
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, 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);
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);
}
{
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;
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;
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;
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;
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);
}
{
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);
}
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;
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);
}
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();
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);
}
}
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, 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);
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;
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;
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;
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;
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;
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);
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);
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);
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;
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, 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);
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;
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;
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;
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;
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;
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;
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);
}
{
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);
}
}
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;
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);
}
}
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);
}
{
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);
}
{
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);
}
}
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;
{
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);
}
{
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);
{
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;
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");
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;
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);
}
{
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);
}
{
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;
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);
}
}
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;
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);
}
{
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);
}
}
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;
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);
}
{
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);
}
}
{
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;
{
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);
}
}
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;
{
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);
}
{
{
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);
}
{
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);
}
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;
{
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));
{
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));
{
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));
{
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));
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;
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;
{
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);
}
{
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);
}
{
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);
}
}
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<ghobject_t> all;
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);
}
{
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);
}
}
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<ghobject_t> all;
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);
}
{
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);
}
}
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<ghobject_t> all, saw;
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);
}
{
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);
}
}
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),
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);
}
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);
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;
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(),
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;
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(),
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;
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));
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);
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());
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);
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);
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);
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);
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.
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;
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);
}
}
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),
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
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);
}
}
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),
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),
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);
}
{
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);
}
}
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)));
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)));
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);
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);
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);
}
}
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)));
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);
}
{
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);
}
}
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) {
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);
}
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);
}
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);
}
{
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);
}
{
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) {
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);
}
++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);
}
}
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) {
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);
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;
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);
}
{
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);
}
}
{
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 = "";
{
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);
++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);
}
{
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";
{
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);
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);
++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);
}
{
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);
}
t.omap_clear(cid, hoid);
map<string, bufferlist> 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);
}
to_add.insert(pair<string, bufferlist>("key-" + string(buf), bl));
attrs.insert(pair<string, bufferlist>("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);
}
set<string> 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);
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();
map<string, bufferlist> to_add;
to_add.insert(pair<string, bufferlist>("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;
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);
}
{
{
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);
}
{
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);
}
{
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);
}
t.omap_clear(cid, hoid);
map<string, bufferlist> 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;
}
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];
attrs.insert(pair<string, bufferlist>("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);
}
}
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);
}
}
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);
}
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);
}
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);
}
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);
}
{
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;
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<<common_suffix_size, tid);
- r = apply_transaction(store, tch, std::move(t));
+ r = queue_transaction(store, tch, std::move(t));
ASSERT_EQ(r, 0);
}
t.remove(cid, *i);
if (++size > 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();
}
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();
}
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);
}
{
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;
}
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;
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;
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);
}
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));
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));
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));
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);
}
}
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));
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));
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));
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);
}
}
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);
}
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);
}
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);
}
}
{
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;
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);
}
{
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");
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");
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");
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;
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");
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;
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();
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);
}
}
{
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);
}
{
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);
{
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);
}
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);
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");
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
// 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);
}
{
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);
}
{
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");
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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");
{
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);
}
{
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);
}
{
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);
}
{
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");
{
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);
}
{
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);
}
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);
}
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");
{
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);
}
{
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) {
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
// 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);
}
// 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);
}
{
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",
{
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) {
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);
}
{
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) {
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);
}
} 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);\
}
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, 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);
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);
}
}