]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: in do_op, requeue op if we requeue waiters in agent_choose_mode 4228/head
authorSamuel Just <sjust@redhat.com>
Mon, 30 Mar 2015 21:04:29 +0000 (14:04 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 31 Mar 2015 16:20:28 +0000 (09:20 -0700)
The current op might be ordered after a waiter.

Fixes: 11280
Backport: firefly
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index a49a2ff2f2a9a152c7d245fa173b2594b9eddf6b..9e565ff95d7f0dbedb7cb0f1cd57f16a62d1b114 100644 (file)
@@ -1539,7 +1539,8 @@ void ReplicatedPG::do_op(OpRequestRef& op)
   }
 
   if (agent_state) {
-    agent_choose_mode();
+    if (agent_choose_mode(false, op))
+      return;
   }
 
   if ((m->get_flags() & CEPH_OSD_FLAG_IGNORE_CACHE) == 0 &&
@@ -10858,12 +10859,13 @@ void ReplicatedPG::agent_choose_mode_restart()
   unlock();
 }
 
-void ReplicatedPG::agent_choose_mode(bool restart)
+bool ReplicatedPG::agent_choose_mode(bool restart, OpRequestRef op)
 {
+  bool requeued = false;
   // Let delay play out
   if (agent_state->delaying) {
     dout(20) << __func__ << this << " delaying, ignored" << dendl;
-    return;
+    return requeued;
   }
 
   uint64_t divisor = pool.info.get_pg_num_divisor(info.pgid.pgid);
@@ -11011,8 +11013,11 @@ void ReplicatedPG::agent_choose_mode(bool restart)
            << dendl;
     if (agent_state->evict_mode == TierAgentState::EVICT_MODE_FULL &&
        is_active()) {
+      if (op)
+       requeue_op(op);
       requeue_ops(waiting_for_active);
       requeue_ops(waiting_for_cache_not_full);
+      requeued = true;
     }
     agent_state->evict_mode = evict_mode;
   }
@@ -11040,6 +11045,7 @@ void ReplicatedPG::agent_choose_mode(bool restart)
       osd->agent_adjust_pg(this, old_effort, agent_state->evict_effort);
     }
   }
+  return requeued;
 }
 
 void ReplicatedPG::agent_estimate_atime_temp(const hobject_t& oid,
index c213b285558ac67c4fdf66859b9c260b47f0b511..6539408e83667644a123ac71b0a3d2ffbc099b3c 100644 (file)
@@ -917,7 +917,8 @@ protected:
   /// clear agent state
   void agent_clear();
 
-  void agent_choose_mode(bool restart = false);  ///< choose (new) agent mode(s)
+  /// choose (new) agent mode(s), returns true if op is requeued
+  bool agent_choose_mode(bool restart = false, OpRequestRef op = OpRequestRef());
   void agent_choose_mode_restart();
 
   /// true if we can send an ondisk/commit for v