@@ -1122,14 +1122,33 @@ seastar::future<> OSD::committed_osd_maps(
11221122 ceph_assert (seastar::this_shard_id () == PRIMARY_CORE);
11231123 INFO (" osd.{} ({}, {})" , whoami, first, last);
11241124 // advance through the new maps
1125+ auto old_map = osdmap;
11251126 return seastar::do_for_each (boost::make_counting_iterator (first),
11261127 boost::make_counting_iterator (last + 1 ),
1127- [this ](epoch_t cur) {
1128+ [this , old_map, FNAME ](epoch_t cur) {
11281129 return pg_shard_manager.get_local_map (
11291130 cur
1130- ).then ([this ](OSDMapService::local_cached_map_t && o) {
1131+ ).then ([this , old_map, FNAME ](OSDMapService::local_cached_map_t && o) {
11311132 osdmap = make_local_shared_foreign (OSDMapService::local_cached_map_t (o));
1132- return pg_shard_manager.update_map (std::move (o));
1133+ std::set<int > old_osds;
1134+ old_map->get_all_osds (old_osds);
1135+ return seastar::parallel_for_each (
1136+ old_osds,
1137+ [this , FNAME, old_map](auto &osd_id) {
1138+ DEBUG (" osd.{}: whoami ? {}, old up ? {} , now down ? {}" ,
1139+ osd_id, osd_id != whoami,
1140+ old_map->is_up (osd_id), osdmap->is_down (osd_id));
1141+ if (osd_id != whoami &&
1142+ old_map->is_up (osd_id) &&
1143+ osdmap->is_down (osd_id)) {
1144+ DEBUG (" osd.{}: mark osd.{} down" , whoami, osd_id);
1145+ return cluster_msgr->mark_down (
1146+ osdmap->get_cluster_addrs (osd_id).front ());
1147+ }
1148+ return seastar::now ();
1149+ }).then ([this , o=std::move (o)]() mutable {
1150+ return pg_shard_manager.update_map (std::move (o));
1151+ });
11331152 }).then ([this ] {
11341153 if (get_shard_services ().get_up_epoch () == 0 &&
11351154 osdmap->is_up (whoami) &&
@@ -1170,7 +1189,9 @@ seastar::future<> OSD::committed_osd_maps(
11701189 return seastar::now ();
11711190 }
11721191 }
1173- return fut.then ([FNAME, this ] {
1192+ return fut.then ([this ] {
1193+ return update_heartbeat_peers ();
1194+ }).then ([FNAME, this ] {
11741195 return check_osdmap_features ().then ([FNAME, this ] {
11751196 // yay!
11761197 INFO (" osd.{}: committed_osd_maps: broadcasting osdmaps up"
0 commit comments