From: Zhiqiang Wang Date: Fri, 21 Aug 2015 02:56:51 +0000 (+0800) Subject: osd: do either flush or evict but not both in agent_work X-Git-Tag: v9.1.0~277^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5627%2Fhead;p=ceph.git osd: do either flush or evict but not both in agent_work An cache pool object is either dirty or not. It's unlikely the agent will do both flush and evict at the same time for an object. Signed-off-by: Zhiqiang Wang --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 7064b3a23d8..c8d0dc1e8cb 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -10694,8 +10694,8 @@ bool ReplicatedPG::agent_work(int start_max, int agent_flush_quota) if (agent_state->evict_mode != TierAgentState::EVICT_MODE_IDLE && agent_maybe_evict(obc)) ++started; - if (agent_state->flush_mode != TierAgentState::FLUSH_MODE_IDLE && - agent_flush_quota > 0 && agent_maybe_flush(obc)) { + else if (agent_state->flush_mode != TierAgentState::FLUSH_MODE_IDLE && + agent_flush_quota > 0 && agent_maybe_flush(obc)) { ++started; --agent_flush_quota; }