Commit Graph

82 Commits

Author SHA1 Message Date
John Spray
3f1693db09
Merge pull request #20875 from jan--f/mgr-server-list-hostname
mgr: add mgr daemon to DaemonStateIndex with metadata (hostname)

Reviewed-by: John Spray <john.spray@redhat.com>
2018-04-24 12:36:48 +01:00
John Spray
37484af0b8 mgr: rework kv store load path
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>
2018-04-23 07:29:45 -04:00
Rubab-Syed
3193d40d0d mgr: centralized setting/getting of mgr configs
Signed-off-by: Rubab Syed<rubab.syed21@gmail.com>
2018-04-23 07:29:44 -04:00
Jan Fajerski
5c9db7200e mgr: add mgr daemon to DaemonStateIndex with metadata (hostname)
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>
2018-04-10 11:49:22 +02:00
Jan Fajerski
3eaf1516eb mgr/MetadataUpdate: add daemon_state.notify_update to contructor
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>
2018-04-10 11:49:22 +02:00
Sage Weil
cf68ce511f mgr: have MgrStandby send mgr reports to active mgr (even self!)
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>
2018-03-06 14:44:48 -06:00
John Spray
2dca5b436a mgr: die on bind() failure
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>
2018-02-26 17:14:03 +00:00
John Spray
834bc27940 mgr: load command definitions earlier
...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>
2018-01-24 13:08:20 -05:00
Patrick Donnelly
4042bec19d
mon: revert mds metadata argument name change
Partial revert of PR #18512: d1877b68d9

Fixes: http://tracker.ceph.com/issues/22527

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2018-01-11 14:47:38 -08:00
Jos Collin
3b6d6031ca mon,mgr,doc,test: standardize argument as role
`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>
2017-12-06 10:01:25 +05:30
Kefu Chai
e0a7ef57e0
Merge pull request #18484 from Liuchang0812/wip-mgr-request-osd-metadata
mgr: request daemon's metadata when receiving a report from an unknown server

Reviewed-by: John Spray <john.spray@redhat.com>
2017-11-18 21:04:37 +08:00
Chang Liu
a39813837c mgr: request daemon's metadata when receiving a report message from an unknown server
Fixes: http://tracker.ceph.com/issues/21687

Signed-off-by: Chang Liu <liuchang0812@gmail.com>
2017-11-16 11:29:46 +08:00
John Spray
c1471c7501 mgr: standby modules come up and run now
...they still don't have access to any config though.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-11-01 08:20:21 -04:00
John Spray
70d45a6b93 mgr: clean up python source file naming
Signed-off-by: John Spray <john.spray@redhat.com>
2017-11-01 08:20:20 -04:00
John Spray
9718896c8b mgr: refactor python module management
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>
2017-11-01 08:20:20 -04:00
John Spray
a0183a63fa mgr: enable python modules to advertise their service URI
Fixes: http://tracker.ceph.com/issues/17460
Signed-off-by: John Spray <john.spray@redhat.com>
2017-11-01 08:20:20 -04:00
Jos Collin
a38ad9714a mgr: silence warning from -Wsign-compare
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>
2017-09-21 14:36:38 +05:30
liuchang0812
2908013433 mgr: kill MgrSession when MMgrReport come from daemon without metadata info
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
2017-09-12 20:17:39 +08:00
Yanhu Cao
cb26eead3f mgr/Mgr: implement completion of osd MetadataUpdate
Fixes: http://tracker.ceph.com/issues/21159

Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
2017-08-29 08:44:01 +08:00
Sage Weil
f236b5e783 mgr/DaemonState: add per DaemonState lock
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-21 11:30:02 -04:00
Kefu Chai
0193e38b3f Merge pull request #16028 from jcsp/wip-mgr-commands
mon: load mgr commands at runtime

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-07-21 18:16:13 +08:00
Sage Weil
2ebb8e13f6 mon: 'config-key list' -> 'config-key ls'
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-19 12:32:48 -04:00
Sage Weil
c86c8b717e mgr: move mgr_commands to separate compilation unit
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-19 08:58:40 -04:00
John Spray
5c3846306b mgr: transmit command descriptions to mgr in activating beacon
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>
2017-07-19 08:58:40 -04:00
Sage Weil
110e60f4e3 mgr/Mgr: debug init a bit more
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-14 16:07:28 -04:00
John Spray
62935db879 mgr: expose a MgrMap in PyModules
Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-14 10:05:54 -04:00
Sage Weil
7e142534bc Merge pull request #16020 from jcsp/wip-20383
mgr: clean up daemon start process

Reviewed-by: Sage Weil <sage@redhat.com>
2017-07-14 09:04:16 -05:00
Dan Mick
617c96014b Mgr: increase debug level for ticks 0 -> 10
Signed-off-by: Dan Mick <dmick@redhat.com>
2017-07-12 12:51:43 -07:00
Sage Weil
97cfc3cb69 mgr: allow/track service registrations
Signed-off-by: Sage Weil <sage@redhat.com>
2017-07-08 22:30:28 -04:00
Sage Weil
a22b256bad mgr: index daemon state by string service type
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>
2017-07-08 22:30:27 -04:00
John Spray
e0e87da652 mgr: send beacon to mon as soon as done with Mgr::init
...instead of waiting for next periodic beacon.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-07-04 19:07:58 -04:00
John Spray
f25763208f mgr: wait for mon digest on startup
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>
2017-07-04 19:07:04 -04:00
Sage Weil
16fcee1f71 mon,mgr: manage mgr module list in mgrmap
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>
2017-06-29 23:10:51 -04:00
Sage Weil
6c10417f7e mgr: include MgrMap in ClusterState
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-29 23:10:00 -04:00
John Spray
67bd8c40ed mgr: cluster log message on plugin load error
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>
2017-06-27 10:59:07 +01:00
Sage Weil
c2e346cf12 Merge pull request #15562 from tchaikov/wip-no-assert.h
common,osdc: remove atomic_t completely

Reviewed-by: Sage Weil <sage@redhat.com>
2017-06-08 20:38:23 -05:00
Sage Weil
30ae537a55 mgr/Mgr: fix deadlock in load_config
Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-08 14:30:10 -04:00
Kefu Chai
28c8373734 msg,common: do not include assert.h everywhere to clobber <assert.h>
* 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>
2017-06-08 11:46:26 +08:00
Kefu Chai
c7034595b8 Merge pull request #14866 from chardan/jfw-wip-halflife_atomic_t-varan
common,test: migrate atomic_t to std::atomic

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-06-08 09:57:26 +08:00
Jesse Williamson
c93daaf92b compile fixups for dout
Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
2017-06-02 12:02:04 -07:00
Sage Weil
578cd59dd8 mgr: drop useless __func__ prints
This is part of the default prefix.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-06-02 13:02:53 -04:00
Kefu Chai
74752505bf mgr: add a command "mgr report"
* 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>
2017-06-02 13:02:46 -04:00
Greg Farnum
ff1258e7ef mgr: introduce tick() calls through the system
Still empty for the moment

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:58:15 -04:00
Greg Farnum
8d803e0483 MonClient: support "passthrough" of MonMap messages so other Dispatchers can see them
Use this in the Manager so it can notify of new monitor maps.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2017-06-02 12:58:14 -04:00
Sage Weil
9af1a1eba1 Merge pull request #14937 from SpandanKumarSahu/bug#17453
mgr: remove non-existent MDS daemons from FSMap

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2017-05-10 07:21:02 -05:00
Spandan Kumar Sahu
6f10373b7a mgr: remove non-existent MDS daemons from FSMap
Fixes: http://tracker.ceph.com/issues/17453
Signed-off-by: Spandan Kumar Sahu <spandankumarsahu@gmail.com>
2017-05-05 16:54:58 +05:30
John Spray
3746e209d8 mgr: embed Client instance for mds_command
Now plugins can talk to MDS daemons.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-05-03 13:37:52 +08:00
John Spray
562089d2a1 mgr: expose Objecter to PyModules
Same motivation as exposing MonClient: so that modules
can get at the command sending code.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-05-03 10:37:17 +08:00
John Spray
f79ae2504a mgr: fix message refcounting
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>
2017-04-30 10:30:03 +08:00
John Spray
b1e5d492d6 mgr: fix deadlock in dispatch
Signed-off-by: John Spray <john.spray@redhat.com>
2017-04-30 10:30:03 +08:00