Add remove then write object in a transaction.
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
r = store->apply_transaction(t);
ASSERT_EQ(r, 0);
}
+ {
+ ObjectStore::Transaction t;
+ t.remove(cid, hoid);
+ t.touch(cid, hoid);
+ cerr << "Remove then create" << std::endl;
+ r = store->apply_transaction(t);
+ ASSERT_EQ(r, 0);
+ }
+ {
+ ObjectStore::Transaction t;
+ bufferlist bl;
+ bl.append("abcde");
+ t.remove(cid, hoid);
+ t.write(cid, hoid, 10, 5, bl);
+ cerr << "Remove then create" << std::endl;
+ r = store->apply_transaction(t);
+ ASSERT_EQ(r, 0);
+ }
{
ObjectStore::Transaction t;
t.remove(cid, hoid);