From 3cd63b93878c4dd09159cb6c6547e4c3d292826d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 30 Jul 2018 09:40:35 -0500 Subject: [PATCH] osd: kick split children 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 --- src/osd/OSD.cc | 13 ++++++++++++- src/osd/OSD.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 022e2c46d5b..668771af710 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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( + epoch, + epoch, + NullEvt()))); + sdata_wait_lock.Lock(); sdata_cond.SignalOne(); sdata_wait_lock.Unlock(); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 463ff4e00bb..43bea304458 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1803,6 +1803,7 @@ protected: ThreadPool::TPHandle& handle); friend class PG; + friend class OSDShard; friend class PrimaryLogPG; -- 2.39.5