From: Sage Weil Date: Thu, 31 Jul 2014 16:13:11 +0000 (-0700) Subject: osd/ReplicatedPG: check agent_mode if agent is enabled but hit_sets aren't X-Git-Tag: v0.80.6~99 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8ff48d79697e98dca04799ee5982a5308a4efc92;p=ceph.git osd/ReplicatedPG: check agent_mode if agent is enabled but hit_sets aren't 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 (cherry picked from commit 5d1c76f641310f5f65600f70ae76945b2aa472d7) --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index b2b1efb23075..4a2b740b9fdf 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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 &&