Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nautilus: mgr: update mon metadata when monmap is updated #39075

Merged
merged 1 commit into from Feb 1, 2021

Conversation

k0ste
Copy link
Contributor

@k0ste k0ste commented Jan 26, 2021

backport tracker: https://tracker.ceph.com/issues/49005


backport of #38932
parent tracker: https://tracker.ceph.com/issues/48905

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/master/src/script/ceph-backport.sh

@k0ste k0ste force-pushed the wip-49005-nautilus branch 2 times, most recently from a8e3a38 to 36d0339 Compare January 26, 2021 12:35
there is chance that some monitor(s) is updated / upgraded in a single
monmap update without being removed from cluster state's metata first,
so, without this change, we will not update the metadata associated with
that monitor, hence the mgr modules which consumes the metadata is not
updated accordingly and keep reporting the stale information.

in this change, we always update the metadata associated with all monitor
included by the latest monmap. multiple "mon metadata" commands are sent
to monitor for retrieving their updated metadata, instead of sending a
single one, so that we can reuse "MetadataUpdate" to update the metadata
of a given daemon. as the number of monitors in a typical cluster is
relatively small, and the frequency of monmap update is low, so this
overhead should be fine.

unlike other places where we ask mon for metadata in Mgr class, the code
sending the mon command for updated monitor metata is located outside of
`cluster_state.with_monmap()` block, the reason is that `with_monmap()`
is guraded by the monc_lock under the hood, while `start_mon_command()`
also need to acquire the monc_lock, which is not a recursive lock. so we
have to do this out of the `with_monmap()` block.

Fixes: https://tracker.ceph.com/issues/48905
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit c037f4c)

backport:
  - path: src/mgr/Mgr.cc
    comment: nautilus don't declared `fmt`
@neha-ojha neha-ojha added this to the nautilus milestone Jan 28, 2021
@smithfarm
Copy link
Contributor

jenkins test make check

@yuriw
Copy link
Contributor

yuriw commented Jan 28, 2021

@yuriw yuriw merged commit b3ad609 into ceph:nautilus Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants