{
LOG_PREFIX(SeaStore::create_new_collection);
DEBUG("{}", cid);
- auto c = _get_collection(cid);
- return repeat_with_internal_context(
- c,
- ceph::os::Transaction{},
- [this, cid](auto &ctx) {
- return _create_collection(
- ctx,
- cid,
- 4 /* TODO */
- ).safe_then([this, &ctx] {
- return transaction_manager->submit_transaction(std::move(ctx.transaction));
- });
- }).then([c] {
- return CollectionRef(c);
- });
+ return seastar::make_ready_future<CollectionRef>(_get_collection(cid));
}
seastar::future<CollectionRef> SeaStore::open_collection(const coll_t& cid)
return seastore->create_new_collection(coll_name);
}).then([this](auto coll_ref) {
coll = coll_ref;
+ CTransaction t;
+ t.create_collection(coll_name, 4);
+ return seastore->do_transaction(
+ coll,
+ std::move(t));
});
}
coll_t test_coll{spg_t{pg_t{1, 0}}};
{
seastore->create_new_collection(test_coll).get0();
+ {
+ CTransaction t;
+ t.create_collection(test_coll, 4);
+ do_transaction(std::move(t));
+ }
auto collections = seastore->list_collections().get0();
EXPECT_EQ(collections.size(), 2);
EXPECT_TRUE(contains(collections, coll_name));
}
{
- CTransaction t;
- t.remove_collection(test_coll);
- do_transaction(std::move(t));
+ {
+ CTransaction t;
+ t.remove_collection(test_coll);
+ do_transaction(std::move(t));
+ }
auto collections = seastore->list_collections().get0();
EXPECT_EQ(collections.size(), 1);
EXPECT_TRUE(contains(collections, coll_name));