break;
}
result = _delete_oid(ctx, true);
+ if (result >= 0) {
+ // mark that this is a cache eviction to avoid triggering normal
+ // make_writeable() clone or snapdir object creation in finish_ctx()
+ ctx->cache_evict = true;
+ }
osd->logger->inc(l_osd_tier_evict);
}
break;
if ((ctx->obs->exists && !ctx->obs->oi.is_whiteout()) && // head exist(ed)
snapc.snaps.size() && // there are snaps
+ !ctx->cache_evict &&
snapc.snaps[0] > ctx->new_snapset.seq) { // existing object is old
// clone
hobject_t coid = soid;
ctx->snapset_obc->obs.exists = false;
}
}
- } else if (ctx->new_snapset.clones.size()) {
+ } else if (ctx->new_snapset.clones.size() &&
+ !ctx->cache_evict) {
// save snapset on _snap
hobject_t snapoid(soid.oid, soid.get_key(), CEPH_SNAPDIR, soid.hash,
info.pgid.pool(), soid.get_namespace());
bool modify; // (force) modification (even if op_t is empty)
bool user_modify; // user-visible modification
bool undirty; // user explicitly un-dirtying this object
+ bool cache_evict; ///< true if this is a cache eviction
// side effects
list<watch_info_t> watch_connects;
ReplicatedPG *_pg) :
op(_op), reqid(_reqid), ops(_ops), obs(_obs), snapset(0),
new_obs(_obs->oi, _obs->exists),
- modify(false), user_modify(false), undirty(false),
+ modify(false), user_modify(false), undirty(false), cache_evict(false),
bytes_written(0), bytes_read(0), user_at_version(0),
current_osd_subop_num(0),
op_t(NULL),