From: Sage Weil Date: Wed, 25 Nov 2015 19:40:26 +0000 (-0500) Subject: osd: recency should look at newest (not oldest) hitsets X-Git-Tag: v10.0.3~161^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6702%2Fhead;p=ceph.git osd: recency should look at newest (not oldest) hitsets Reported-by: xinxin shu Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 1b1f5c5df83..c9d0c4c13d8 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2259,8 +2259,9 @@ bool ReplicatedPG::maybe_promote(ObjectContextRef obc, if (count) { // Check if in other hit sets const hobject_t& oid = obc.get() ? obc->obs.oi.soid : missing_oid; - for (map::iterator itor = agent_state->hit_set_map.begin(); - itor != agent_state->hit_set_map.end(); + for (map::reverse_iterator itor = + agent_state->hit_set_map.rbegin(); + itor != agent_state->hit_set_map.rend(); ++itor) { if (!itor->second->contains(oid)) { break;