From ae56de09fe1385958b5b600d1f0c91383989926f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 25 Nov 2015 14:40:26 -0500 Subject: [PATCH] osd: recency should look at newest (not oldest) hitsets Reported-by: xinxin shu Signed-off-by: Sage Weil (cherry picked from commit 528eae92d010ea34ae8cf0e8b2290aaa5e058d24) Conflicts: src/osd/ReplicatedPG.cc code section was moved to ReplicatedPG::maybe_promote in master. Signed-off-by: Robert LeBlanc --- src/osd/ReplicatedPG.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index bfaa16bb9b4..897a77cc633 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1860,8 +1860,9 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op, 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; -- 2.47.3