From: Zhiqiang Wang Date: Tue, 2 Jun 2015 08:36:56 +0000 (+0800) Subject: osd: purge the object from the cache when proxying and not promoting the op X-Git-Tag: v9.1.0~345^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da68bb371f8b06b85a73077cd069a294193ac6c0;p=ceph.git osd: purge the object from the cache when proxying and not promoting the op 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 96f0994eb852..224454a8ab4b 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1863,10 +1863,15 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op, } // 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)