]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor: only send pg create messages to up osds
authorSage Weil <sage@redhat.com>
Thu, 8 Oct 2015 16:12:34 +0000 (12:12 -0400)
committerSage Weil <sage@redhat.com>
Mon, 23 Nov 2015 13:38:51 +0000 (08:38 -0500)
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 <sage@redhat.com>
src/mon/PGMonitor.cc

index 0a0d48eed5fb95e031f3dfdeafeab2997e4ae7bc..0e305d9fc9ea2c1a41bf265f1f308b6dbc537413 100644 (file)
@@ -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);
+    }
   }
 }