]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do either flush or evict but not both in agent_work 5627/head
authorZhiqiang Wang <zhiqiang.wang@intel.com>
Fri, 21 Aug 2015 02:56:51 +0000 (10:56 +0800)
committerZhiqiang Wang <zhiqiang.wang@intel.com>
Fri, 21 Aug 2015 02:56:51 +0000 (10:56 +0800)
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 <zhiqiang.wang@intel.com>
src/osd/ReplicatedPG.cc

index 7064b3a23d80c59bf51837c41e32d2c3a11519b0..c8d0dc1e8cb55e7fdadda5683067e56412ef89f2 100644 (file)
@@ -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;
     }