]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix requeue of replay requests during activating 6036/head
authorSage Weil <sage@redhat.com>
Tue, 22 Sep 2015 17:57:37 +0000 (13:57 -0400)
committerSage Weil <sage@redhat.com>
Tue, 22 Sep 2015 18:00:06 +0000 (14:00 -0400)
If the replay period expires while we are still in the activating
state, we can simply insert our list of requests at the front of
the waiting_for_active list.

Fixes: #13116
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h

index 7e0cec564dbc91c00fef07ec694eb1346b673ec8..67d2936c452a026b80ba00bea50be4e03e2ce253 100644 (file)
@@ -7801,11 +7801,11 @@ void OSD::check_replay_queue()
       PG *pg = _lookup_lock_pg_with_map_lock_held(pgid);
       pg_map_lock.unlock();
       dout(10) << "check_replay_queue " << *pg << dendl;
-      if (pg->is_active() &&
-          pg->is_replay() &&
+      if ((pg->is_active() || pg->is_activating()) &&
+         pg->is_replay() &&
           pg->is_primary() &&
           pg->replay_until == p->second) {
-        pg->replay_queued_ops();
+       pg->replay_queued_ops();
       }
       pg->unlock();
     } else {
index 3bdb13cbbd48b4d58025d34168fe0478f3c34fcf..d585dea58cdff25064305063efe541db574f8024 100644 (file)
@@ -1890,6 +1890,7 @@ void PG::queue_op(OpRequestRef& op)
 void PG::replay_queued_ops()
 {
   assert(is_replay());
+  assert(is_active() || is_activating());
   eversion_t c = info.last_update;
   list<OpRequestRef> replay;
   dout(10) << "replay_queued_ops" << dendl;
@@ -1910,9 +1911,13 @@ void PG::replay_queued_ops()
     replay.push_back(p->second);
   }
   replay_queue.clear();
-  requeue_ops(replay);
-  requeue_ops(waiting_for_active);
-  assert(waiting_for_peered.empty());
+  if (is_active()) {
+    requeue_ops(replay);
+    requeue_ops(waiting_for_active);
+    assert(waiting_for_peered.empty());
+  } else {
+    waiting_for_active.splice(waiting_for_active.begin(), replay);
+  }
 
   publish_stats_to_osd();
 }
index 7859f1a5a3c0de7343382e43eb6e25daacc18000..f94cae83098cb06fc00487577b749dce88d68f16 100644 (file)
@@ -2118,6 +2118,7 @@ public:
 
   int get_state() const { return state; }
   bool       is_active() const { return state_test(PG_STATE_ACTIVE); }
+  bool       is_activating() const { return state_test(PG_STATE_ACTIVATING); }
   bool       is_peering() const { return state_test(PG_STATE_PEERING); }
   bool       is_down() const { return state_test(PG_STATE_DOWN); }
   bool       is_replay() const { return state_test(PG_STATE_REPLAY); }