From c94ac44ab41fc62add3fc93c5c7ce06950eed3f1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 9 May 2014 09:20:34 -0700 Subject: [PATCH] osd: handle race between osdmap and prepare_to_stop If we get a MOSDMarkMeDown message and set service.state == STOPPING, we kick the prepare_to_stop() thread. Normally, it will wake up and then set osd.state == STOPPING, and when we process the map message next we will not warn. However, if dispatch() takes the lock instead and processes the map, it will fail the preparing_to_stop check and issue a spurious warning. Fix by checking for either preparing_to_stop or stopping. Fixes: #8319 Backport: firefly, emperor, dumpling Signed-off-by: Sage Weil (cherry picked from commit 6b858be0676f937a99dbd51321497f30c3a0097f) --- src/osd/OSD.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 4240ba8546eb3..db20524997af9 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -5571,7 +5571,7 @@ void OSD::handle_osd_map(MOSDMap *m) (osdmap->get_hb_front_addr(whoami) != entity_addr_t() && !osdmap->get_hb_front_addr(whoami).probably_equals(hb_front_server_messenger->get_myaddr()))) { if (!osdmap->is_up(whoami)) { - if (service.is_preparing_to_stop()) { + if (service.is_preparing_to_stop() || service.is_stopping()) { service.got_stop_ack(); } else { clog.warn() << "map e" << osdmap->get_epoch() -- 2.39.5