The locking and blocking around this was a bit
tricky. Do the simple thing, and pull the
load_store out to Mgr so that it can be safely
done as part of the background_init process (just drop
Mgr::lock across blocking actions).
Signed-off-by: John Spray <john.spray@redhat.com>
This commit changes when (and how) the mgr daemons are added to the
DaemonStateIndex. A change in the mgr map now doesn't immediately
trigger the addition of a mgr daemon, but triggers a MetadataUpdate
operation so that the mgr daemon is added with metadata queried from the
mon (most notably the hostname).
Fixes: http://tracker.ceph.com/issues/23286
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
Before updating metadata a call site should check if an update has
already been triggered. Adding the notify_update call to the constructor
makes sure the correct info for this check is present.
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
This allows the mgr daemons to register state with the active mgr just
like the rest of the cluster, including perfcounters and current config.
Signed-off-by: Sage Weil <sage@redhat.com>
Previously, the daemon would get wedged if it
competed for the same port as another daemon
on the same host and lost.
Fixes: https://tracker.ceph.com/issues/23037
Signed-off-by: John Spray <john.spray@redhat.com>
...and for all modules, not just the active ones.
This enables us to give better feedback to the user
when they try and use a command from a disabled module,
and also fixes the race between enabling a module and
trying to use its commands.
Fixes: http://tracker.ceph.com/issues/21683
Signed-off-by: John Spray <john.spray@redhat.com>
`ceph rmfailed` refers to its argument as "who" and `ceph repaired` refers to its argument as "rank". We should make these commands and others consistent by standardizing the argument as "role".
Fixes: http://tracker.ceph.com/issues/21393
Signed-off-by: Jos Collin <jcollin@redhat.com>
Separate out the *loading* of modules from
the *running* of modules.
This is a precursor to enabling modules to run
in standby mode.
Signed-off-by: John Spray <john.spray@redhat.com>
Fixed the warning:
ceph/src/mgr/Mgr.cc: In lambda function:
ceph/src/mgr/Mgr.cc:413:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (unsigned int osd_id = 0; osd_id < osd_map.get_max_osd(); ++osd_id) {
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jos Collin <jcollin@redhat.com>
The mgr already sends a beacon to the mon immediately
after loading python modules in Mgr::init, to indicate
that it is now available. Use that beacon to transmit
the command descriptions.
The monitor should handle this beacon by persisting
the command descriptions before persisting the updated
mgrmap that indicates that the mgr is now active.
Signed-off-by: John Spray <john.spray@redhat.com>
If we use a string we can allow for other service names like
'rgw' and 'rbd-mirror' and 'iscsigw' and so on.
Signed-off-by: Sage Weil <sage@redhat.com>
This is to avoid starting the python modules
before the mon_status and health information
is available.
Fixes: http://tracker.ceph.com/issues/20383
Signed-off-by: John Spray <john.spray@redhat.com>
Kill old mgr_modules option.
Add new mgr_initial_modules option, on the mon, for the initial cluster
mgrmap.
Add ls, enable, disable commands.
Respawn mgr if the module list changes. In the future we could enable
new modules without a full restart, but disabling probably requires (and
is best handled by) a respawn.
Signed-off-by: Sage Weil <sage@redhat.com>
To make it a bit more obvious what's going on, otherwise
user's first sign is when they try and use a CLI bit
and get a command not found.
Signed-off-by: John Spray <john.spray@redhat.com>
* reverts c93daaf92b
* add "#include "include/assert.h" to where <cassert> or <assert.h> are
included, or avoid including them if possible.
Signed-off-by: Kefu Chai <kchai@redhat.com>
* extract send_report() out of tick() so it can be reused.
* add a commmand "mgr report-mon" for mgr, so we are able to flush the
the mgr stats to mon actively without waiting for the tick. this
could help with the tests.
Signed-off-by: Kefu Chai <kchai@redhat.com>
Let's be consistent and push the m->put down into
the handle_(M<class>* m) functions the way
we do in the rest of the codebase.
Signed-off-by: John Spray <john.spray@redhat.com>