From aa911767d9326c8aa37671883892b7d383596960 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Thu, 13 Aug 2015 13:47:24 +0200 Subject: [PATCH] osd: trigger the cache agent after a promotion When a proxy read happens, the object promotion is done in parallel. The agent_choose_mode function must be called to reconsider the situation to protect against the following scenario: * proxy read * agent_choose_mode finds no object exists and the agent goes idle * object promotion happens * the agent does not reconsider and eviction does not happen although it should http://tracker.ceph.com/issues/12673 Fixes: #12673 Signed-off-by: Loic Dachary (cherry picked from commit e1f58feb9b1d20b72f2eb2eefdea5982e0cddccd) --- src/osd/ReplicatedPG.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5504b2be41d88..797a0a39d22ca 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6050,6 +6050,10 @@ void ReplicatedPG::finish_promote(int r, OpRequestRef op, simple_repop_submit(repop); osd->logger->inc(l_osd_tier_promote); + + assert(agent_state); + if (agent_state->is_idle()) + agent_choose_mode(); } void ReplicatedPG::cancel_copy(CopyOpRef cop, bool requeue) -- 2.39.5