From 3ad0c9215f667732eea45034a7e81de2cd33eb40 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 8 Oct 2015 12:12:34 -0400 Subject: [PATCH] mon/PGMonitor: only send pg create messages to up osds If the OSD is down it will ignore the message. If it gets marked up, we will eventually consume that map and call check_subs(). Signed-off-by: Sage Weil --- src/mon/PGMonitor.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 0a0d48eed5f..0e305d9fc9e 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -2357,6 +2357,7 @@ void PGMonitor::check_subs() while (!p.end()) { Subscription *sub = *p; ++p; + dout(20) << __func__ << " .. " << sub->session->inst << dendl; check_sub(sub); } } @@ -2364,8 +2365,13 @@ void PGMonitor::check_subs() void PGMonitor::check_sub(Subscription *sub) { if (sub->type == "osd_pg_creates") { - sub->next = send_pg_creates(sub->session->inst.name.num(), - sub->session->con.get(), - sub->next); + // only send these if the OSD is up. we will check_subs() when they do + // come up so they will get the creates then. + if (sub->session->inst.name.is_osd() && + mon->osdmon()->osdmap.is_up(sub->session->inst.name.num())) { + sub->next = send_pg_creates(sub->session->inst.name.num(), + sub->session->con.get(), + sub->next); + } } } -- 2.47.3