]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do evict before flush in agent_work
authorZhiqiang Wang <zhiqiang.wang@intel.com>
Fri, 21 Aug 2015 02:51:05 +0000 (10:51 +0800)
committerZhiqiang Wang <zhiqiang.wang@intel.com>
Fri, 21 Aug 2015 02:51:05 +0000 (10:51 +0800)
This is to avoid the extreme case that the agent continuously does
flush, but not evict. This may lead to the cache pool to be full.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
src/osd/ReplicatedPG.cc

index c6958664b194c1cc8a53facb07d5fc946ccc8ceb..7064b3a23d80c59bf51837c41e32d2c3a11519b0 100644 (file)
@@ -10691,14 +10691,14 @@ bool ReplicatedPG::agent_work(int start_max, int agent_flush_quota)
       continue;
     }
 
+    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)) {
       ++started;
       --agent_flush_quota;
     }
-    if (agent_state->evict_mode != TierAgentState::EVICT_MODE_IDLE &&
-       agent_maybe_evict(obc))
-      ++started;
     if (started >= start_max) {
       // If finishing early, set "next" to the next object
       if (++p != ls.end())