]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/Monitor.cc: exit function if !osdmon()->is_writeable()
authorKamoltat <ksirivad@redhat.com>
Thu, 6 Apr 2023 17:36:55 +0000 (17:36 +0000)
committerKamoltat <ksirivad@redhat.com>
Tue, 9 May 2023 14:10:44 +0000 (14:10 +0000)
commit4af72c9be6e20dac330bb7b06f40ca6d96a11a77
treedec70d0594bb0ea3a7164813d9b7b77924905b42
parent1a64a81adb6215b2855484686060082146a3738c
mon/Monitor.cc: exit function if !osdmon()->is_writeable()

Problem:

In the function `maybe_go_degraded_stretch_mode()`
when `osdmon` is not writeable we shouldn't go into
`trigger_degraded_stretch_mode` because we will
crash at `ceph_assert(osdmon()->is_writeable())`.
The current code does not exit `maybe_go_degraded_stretch_mode()`
when we are waiting for `osdmon` to be writeable, therefore,
we crash.

Solution:

Exit the function by returning nothing after going into
`wait_for_writeable_ctx`, since at that point we would have
queued the context and all we have to do is wait for finish
context to execute `maybe_go_degraded_stretch_mode` again.

Also, added a bit of logging so that user is aware
when `osdmon` and `monmon` are not writeable.

We fix other parts of the monitor code that are missing
the return after `wait_for_writeable_ctx` and `wait_for_readable_ctx`
as well.

Fixes: https://tracker.ceph.com/issues/59271
Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit 7f7c2d51c60c58aeb031ec279a48910bc02444de)
src/mon/Monitor.cc