From 1546d57d71e5ce65c8c0b000882176724ce1a5b2 Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Fri, 21 Aug 2015 10:56:51 +0800 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.47.3