]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: check agent_mode if agent is enabled but hit_sets aren't
authorSage Weil <sage@redhat.com>
Thu, 31 Jul 2014 16:13:11 +0000 (09:13 -0700)
committerSage Weil <sage@redhat.com>
Tue, 12 Aug 2014 22:03:06 +0000 (15:03 -0700)
It is probably not a good idea to try to run the tiering agent without a
hit_set to inform its actions, but it is technically possible.  For
example, one could simply blindly evict when we reach the full point.
However, this doesn't work because the agent mode is guarded by a hit_set
check, even though agent_setup() is not.  Fix that.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 5d1c76f641310f5f65600f70ae76945b2aa472d7)

src/osd/ReplicatedPG.cc

index b2b1efb230756c4e5d12648643f06cb24c46973d..4a2b740b9fdfa49be5170e1c715b90c880747023 100644 (file)
@@ -1352,9 +1352,10 @@ void ReplicatedPG::do_op(OpRequestRef op)
        hit_set_start_stamp + pool.info.hit_set_period <= m->get_recv_stamp()) {
       hit_set_persist();
     }
+  }
 
-    if (agent_state)
-      agent_choose_mode();
+  if (agent_state) {
+    agent_choose_mode();
   }
 
   if ((m->get_flags() & CEPH_OSD_FLAG_IGNORE_CACHE) == 0 &&