return;
}
+ if (m->get_flags() & CEPH_OSD_FLAG_IGNORE_CACHE) {
+ ctx->ignore_cache = true;
+ }
+
if ((op->may_read()) && (obc->obs.oi.is_lost())) {
// This object is lost. Reading from it returns an error.
dout(20) << __func__ << ": object " << obc->obs.oi.soid
// Cannot delete an object with watchers
result = -EBUSY;
} else {
- result = _delete_oid(ctx, false);
+ result = _delete_oid(ctx, ctx->ignore_cache);
}
break;
bool user_modify; // user-visible modification
bool undirty; // user explicitly un-dirtying this object
bool cache_evict; ///< true if this is a cache eviction
+ bool ignore_cache; ///< true if IGNORE_CACHE flag is set
// side effects
list<watch_info_t> watch_connects;
op(_op), reqid(_reqid), ops(_ops), obs(_obs), snapset(0),
new_obs(_obs->oi, _obs->exists),
modify(false), user_modify(false), undirty(false), cache_evict(false),
+ ignore_cache(false),
bytes_written(0), bytes_read(0), user_at_version(0),
current_osd_subop_num(0),
op_t(NULL),
ASSERT_TRUE(it == cache_ioctx.objects_end());
}
+ // delete a whiteout and verify it goes away
ASSERT_EQ(-ENOENT, ioctx.remove("foo"));
+ {
+ ObjectWriteOperation op;
+ op.remove();
+ librados::AioCompletion *completion = cluster.aio_create_completion();
+ ASSERT_EQ(0, ioctx.aio_operate("bar", completion, &op,
+ librados::OPERATION_IGNORE_CACHE));
+ completion->wait_for_safe();
+ ASSERT_EQ(0, completion->get_return_value());
+ completion->release();
+
+ ObjectIterator it = cache_ioctx.objects_begin();
+ ASSERT_TRUE(it != cache_ioctx.objects_end());
+ ASSERT_TRUE(it->first == string("foo"));
+ ++it;
+ ASSERT_TRUE(it == cache_ioctx.objects_end());
+ }
// recreate an object and verify we can read it
{
ASSERT_TRUE(it == cache_ioctx.objects_end());
}
+ // delete a whiteout and verify it goes away
ASSERT_EQ(-ENOENT, ioctx.remove("foo"));
+ {
+ ObjectWriteOperation op;
+ op.remove();
+ librados::AioCompletion *completion = cluster.aio_create_completion();
+ ASSERT_EQ(0, ioctx.aio_operate("bar", completion, &op,
+ librados::OPERATION_IGNORE_CACHE));
+ completion->wait_for_safe();
+ ASSERT_EQ(0, completion->get_return_value());
+ completion->release();
+
+ ObjectIterator it = cache_ioctx.objects_begin();
+ ASSERT_TRUE(it != cache_ioctx.objects_end());
+ ++it;
+ ASSERT_TRUE(it == cache_ioctx.objects_end());
+ }
// recreate an object and verify we can read it
{