]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: kick split children
authorSage Weil <sage@redhat.com>
Mon, 30 Jul 2018 14:40:35 +0000 (09:40 -0500)
committerSage Weil <sage@redhat.com>
Fri, 7 Sep 2018 17:09:05 +0000 (12:09 -0500)
Ensure that we bring split children up to date to the latest map even in
the absence of new OSDMaps feeding in NullEvts.  This is important when
the handle_osd_map (or boot) thread is blocked waiting for pgs to catch
up, but we also need a newly-split child to catch up (perhaps so that it
can merge).

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

index 022e2c46d5b67ccaaef8d4b1fb2b9c8478fed1c6..668771af71013322590eace5d869c630e8c181b4 100644 (file)
@@ -10093,6 +10093,7 @@ void OSDShard::prime_merges(const OSDMapRef& as_of_osdmap,
 
 void OSDShard::register_and_wake_split_child(PG *pg)
 {
+  epoch_t epoch;
   {
     Mutex::Locker l(shard_lock);
     dout(10) << pg->pg_id << " " << pg << dendl;
@@ -10105,7 +10106,7 @@ void OSDShard::register_and_wake_split_child(PG *pg)
     ceph_assert(!slot->waiting_for_split.empty());
     _attach_pg(slot, pg);
 
-    epoch_t epoch = pg->get_osdmap_epoch();
+    epoch = pg->get_osdmap_epoch();
     ceph_assert(slot->waiting_for_split.count(epoch));
     slot->waiting_for_split.erase(epoch);
     if (slot->waiting_for_split.empty()) {
@@ -10115,6 +10116,16 @@ void OSDShard::register_and_wake_split_child(PG *pg)
               << slot->waiting_for_split << dendl;
     }
   }
+
+  // kick child to ensure it pulls up to the latest osdmap
+  osd->enqueue_peering_evt(
+    pg->pg_id,
+    PGPeeringEventRef(
+      std::make_shared<PGPeeringEvent>(
+       epoch,
+       epoch,
+       NullEvt())));
+
   sdata_wait_lock.Lock();
   sdata_cond.SignalOne();
   sdata_wait_lock.Unlock();
index 463ff4e00bb0397d42cc93a77178089cc24f5451..43bea30445809b13f8ca99e15c30dafb62e2bec7 100644 (file)
@@ -1803,6 +1803,7 @@ protected:
     ThreadPool::TPHandle& handle);
 
   friend class PG;
+  friend class OSDShard;
   friend class PrimaryLogPG;