]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: always activate_map in advance_pgs, only send messages if up
authorSamuel Just <sam.just@inktank.com>
Thu, 14 Feb 2013 22:03:56 +0000 (14:03 -0800)
committerSamuel Just <sam.just@inktank.com>
Thu, 14 Feb 2013 22:57:38 +0000 (14:57 -0800)
We should always handle_activate_map() after handle_advance_map() in
order to kick the pg into a valid peering state for processing requests
prior to dropping the lock.

Additionally, we would prefer to avoid sending irrelevant messages
during boot, so only send if we are up according to the current service
osdmap.

Fixes: #4064
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/osd/OSD.cc

index e56818ed523daf56b09228a36aa2759d84d0ec40..09fb58400e9b73b8cd3db2fd52e61854f94838a0 100644 (file)
@@ -4282,8 +4282,7 @@ void OSD::advance_pg(
     lastmap = nextmap;
     handle.reset_tp_timeout();
   }
-  if (!is_booting())
-    pg->handle_activate_map(rctx);
+  pg->handle_activate_map(rctx);
 }
 
 /** 
@@ -5098,11 +5097,13 @@ bool OSD::compat_must_dispatch_immediately(PG *pg)
 
 void OSD::dispatch_context(PG::RecoveryCtx &ctx, PG *pg, OSDMapRef curmap)
 {
-  do_notifies(*ctx.notify_list, curmap);
+  if (service.get_osdmap()->is_up(whoami)) {
+    do_notifies(*ctx.notify_list, curmap);
+    do_queries(*ctx.query_map, curmap);
+    do_infos(*ctx.info_map, curmap);
+  }
   delete ctx.notify_list;
-  do_queries(*ctx.query_map, curmap);
   delete ctx.query_map;
-  do_infos(*ctx.info_map, curmap);
   delete ctx.info_map;
   if ((ctx.on_applied->empty() &&
        ctx.on_safe->empty() &&