]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: handle race between osdmap and prepare_to_stop
authorSage Weil <sage@inktank.com>
Fri, 9 May 2014 16:20:34 +0000 (09:20 -0700)
committerSage Weil <sage@inktank.com>
Mon, 19 May 2014 20:53:14 +0000 (13:53 -0700)
commitc94ac44ab41fc62add3fc93c5c7ce06950eed3f1
tree5073fd514561f55f1f3b3a717442d959766d9bf6
parent22e2e7cff42970b00dc352513f1f138132f78d04
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 <sage@inktank.com>
(cherry picked from commit 6b858be0676f937a99dbd51321497f30c3a0097f)
src/osd/OSD.cc