When proxying the write/cache op, if it is decided to not promote the
object, need to purge it from the object_contexts cache. Otherwise, it
causes problems for the later ops on this object.
Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
}
// Promote too?
+ bool promoting = false;
if (!op->need_skip_promote()) {
- maybe_promote(obc, missing_oid, oloc, in_hit_set,
- pool.info.min_write_recency_for_promote,
- OpRequestRef());
+ promoting = maybe_promote(obc, missing_oid, oloc, in_hit_set,
+ pool.info.min_write_recency_for_promote,
+ OpRequestRef());
+ }
+ // purge the object in the cache if not promoting
+ if (!promoting) {
+ object_contexts.purge(obc->obs.oi.soid);
}
} else {
if (can_proxy_read)