summaryrefslogtreecommitdiffstats
path: root/src/mgr/MgrClient.cc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mgr: templatize/generalize metrics collection interfaceVenky Shankar2019-12-061-3/+8
| | | | | | | | | | | templatize metrics collection so as to reuse quering routines. `MetricCollector` can be subclassed and along with implementing ` process_reports()` to process incoming metrics data. also, generalize metrics data in `MMgrReport` and metric query configuration in `MMgrConfigure`. Signed-off-by: Venky Shankar <vshankar@redhat.com>
* mgr/MgrClient: fix 'tell mgr.x ...'Sage Weil2019-12-041-3/+4
| | | | | | | | | | If we start the command before we get the mgrmap at the client, we will send MCommand via a different code path; make sure it behaves correctly too. Missed this in 6f35d2835268eade059535b62378d6d407ef9e87 Signed-off-by: Sage Weil <sage@redhat.com>
* mds: establish session with mgr only after added to FSMapPatrick Donnelly2019-11-081-0/+1
| | | | | | | | | | | | | Note that we now sub to the mgrmap after init because the MgrClient connection to the mgr is driven by receipt of the MgrMap. This is important so that the MDS does not have metadata with the mgr when the mons are ignoring the MDS otherwise due to CompatSet incompatibilities. Fixes: https://tracker.ceph.com/issues/41538 Fixes: https://tracker.ceph.com/issues/42635 Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
* mgr/MgrClient: fix open condition fixSage Weil2019-11-051-1/+1
| | | | | | | Fix fc60989bf7a72c35b8f6b8fec2407b3080ad9bbd, which reversed this condition. Signed-off-by: Sage Weil <sage@redhat.com>
* mgr/MgrClient: fix open conditionSage Weil2019-10-311-2/+2
| | | | | | | | | | | | | Do not open a mgr daemon session if we are a client using a non-client key to authenticate. This is a bit of a corner case, but it can happen when using the mon. key do bootstrap functions. This aligns the MgrClient condition with the mgr/DaemonServer.cc handle_report condition, which rejects non-daemon client connections based on the connection entity type, not the auth identity. Fixes: https://tracker.ceph.com/issues/42566 Signed-off-by: Sage Weil <sage@redhat.com>
* mgr,mgr/MgrClient: use fsid to signal mon-mgr vs cli MCommandsSage Weil2019-10-041-8/+12
| | | | | | | | | | | | | | | We can't use the feature bit for the MCommand connection to tell whether it is a tell or CLI command because new clients may have to send CLI commands via MCommand for old clusters, and they don't always know whether this mgr is new or old yet. Prior to octopus, MCommand contained a mon/mgr CLI command, and did not have the fsid field set. Start populating the fsid field, and use this to signal whether a client is a new MgrClient that knows MCommand vs MMgrCommand. If we get an MCommand with the fsid set, that means it is a tell command; otherwise, it's an old client sending a CLI command. Signed-off-by: Sage Weil <sage@redhat.com>
* mgr/MgrClient: empty target string for 'tell' means active mgrSage Weil2019-10-041-4/+4
| | | | | | This lets the caller say "tell the active mgr", whoever it may be. Signed-off-by: Sage Weil <sage@redhat.com>
* mgr/MgrClient: add start_command variant that takes a targetSage Weil2019-10-011-4/+62
| | | | | | Note that the initial implementation can only target the active mgr! Signed-off-by: Sage Weil <sage@redhat.com>
* include: convert FunctionContext usage to generic LambdaContextPatrick Donnelly2019-09-161-2/+2
| | | | | | | | The main motivation for this change is to avoid copies due to the use of boost::function/std::function where captures of std::unique_ptr (in subsequent commits) would fail to compile. Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
* mgr/MgrClient: send MMgrCommand for octopus+ mgrsSage Weil2019-09-061-10/+28
| | | | | | | This allows us to (eventually) leave MCommand for tell-style commands only. Signed-off-by: Sage Weil <sage@redhat.com>
* mgr, mon: allow normal ceph services to register with managerVenky Shankar2019-08-061-8/+14
| | | | | | | | | | | Additionally, introduce `task status` field in manager report messages to forward status of executing tasks in daemons (e.g., status of executing scrubs in ceph metadata servers). `task status` makes its way upto service map which is then used to display the relevant information in ceph status. Signed-off-by: Venky Shankar <vshankar@redhat.com>
* mgr: s/Mutex/ceph::mutex/Kefu Chai2019-08-031-15/+15
| | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* mgr/MgrClient: use ref_t<M>Kefu Chai2019-04-181-18/+11
| | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* src/: use make_message<Foo> instead of Foo::create()Kefu Chai2019-04-181-4/+4
| | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* mgr: Update MgrClient to work without using namespaceAdam C. Emerson2019-03-291-2/+7
| | | | Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* mgr/MgrClient: reduce log level when issuing a command when not connectedJason Dillaman2019-01-251-1/+1
| | | | | | | The mgr client will eventually connect and issue the command so it's not necessary to spam the logs at level 0. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
* client: use message smart ptr instead of raw ptrPatrick Donnelly2019-01-101-4/+4
| | | | | | Fixes: http://tracker.ceph.com/issues/37864 Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
* Merge pull request #24141 from liu-chunmei/ceph_seastar_perfcounterKefu Chai2018-11-151-1/+1
|\ | | | | | | | | common,crimson: port perfcounters to seastar Reviewed-by: Kefu Chai <kchai@redhat.com>
| * common: move lock out of PerfCounterCollection and rename itchunmei Liu2018-10-301-1/+1
| | | | | | | | | | | | | | | | extract PerfCounterCollectionImpl and move m_lock out from perfcounters.cc to upper,then seastar osd can reuse functions in perfcounters.cc. Signed-off-by: chunmei Liu <chunmei.liu@intel.com>
* | osd: collect client perf stats when query is enabledMykola Golub2018-11-071-5/+5
|/ | | | | Fixes: https://tracker.ceph.com/issues/36091 Signed-off-by: Mykola Golub <mgolub@suse.com>
* mgr: Mutex::Locker -> std::lock_guardSage Weil2018-10-161-9/+9
| | | | Signed-off-by: Sage Weil <sage@redhat.com>
* Merge pull request #24180 from colletj/wip-35914-mmgrconfigure-osd-queryJason Dillaman2018-10-021-0/+8
|\ | | | | | | | | mgr: update MMgrConfigure message to include optional OSD perf queries Reviewed-by: Jason Dillaman <dillaman@redhat.com>
| * mgr: add optional OSD perf queries to MMgrConfigure messageJulien Collet2018-10-021-0/+8
| | | | | | | | | | Fixes: https://tracker.ceph.com/issues/35914 Signed-off-by: Julien Collet <julien.collet@cern.ch>
* | mgr: Use ceph_assert for asserts.Adam C. Emerson2018-08-271-10/+10
|/ | | | Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* mgr/MgrClient: make some noise for a user if no mgr daemon is runningSage Weil2018-08-081-1/+1
| | | | | | | Otherwise a cli command may unexpectedly hang forever with not output because no ceph-mgr is running, which can be confusing for an admin. Signed-off-by: Sage Weil <sage@redhat.com>
* mgr/MgrClient: Protect daemon_health_metricsBrad Hubbard2018-08-021-0/+1
| | | | | | | | | | Without holiding the lock update_daemon_health() can race with send_report() corrupting the daemon_health_metrics vector. Fixes: http://tracker.ceph.com/issues/23352 Signed-off-by: Kjetil Joergensen <kjetil@medallia.com> Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
* common,rbd,rgw,osd: extract config values into ConfigValuesKefu Chai2018-07-101-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | this change introduce three classes: ConfigValues, ConfigProxy and ConfigReader. in seastar port of OSD, each CPU shard will hold its own reference of configuration, and upon changes of settings, each shard will be updated with the new setting in async. so this forces us to be able to keep two set of configuration at the same time. so we need to extract the changeable part of md_config_t out. so we can replace the old one with new one on demand, and let different shards share the same unchanged part, amon the other things, the Options map and the lookup tables. that's why we need ConfigValues. we will add a policy template for this class, so we can specialize for Seastar implementation to allow different ConfigProxy instances to point md_config_impl<> to different ConfigValues. because the observer interface is still using md_config_t, to minimise the impact of this change, handle_conf_change() and handle_subsys_change() are not changed. but as it accepts a `const md_config_t`, which cannot be used to create/reference the ConfigProxy holding it, we need to introduce ConfigReader for reading the updated setting from md_config_t in a simpler way, without exposing the internal "values" member variable. Signed-off-by: Kefu Chai <kchai@redhat.com>
* mgr: use entity_addrvec_t for MgrMapSage Weil2018-05-311-7/+5
| | | | | | | | | | This does several entity_addr_t -> entity_addrvec_t conversions across the mgr code. (Note that entity_addr_t and entity_addrvec_t already encode in an interoperable way.) Signed-off-by: Sage Weil <sage@redhat.com>
* mgr/MgrClient: add mgr_optional modeJohn Spray2018-05-041-1/+3
| | | | | | | | | This is for use when talking to pre-luminous clusters, where we should not block waiting for MgrMap because it might never come. Fixes: https://tracker.ceph.com/issues/23627 Signed-off-by: John Spray <john.spray@redhat.com>
* mgrc: free MMgrClose in handle_mgr_closeCasey Bodley2018-04-241-0/+1
| | | | | | Fixes: http://tracker.ceph.com/issues/23846 Signed-off-by: Casey Bodley <cbodley@redhat.com>
* Merge pull request #20761 from liewegas/wip-service-unregisterSage Weil2018-04-231-0/+25
|\ | | | | | | | | | | mgr: allow service daemons to unregister from ServiceMap Reviewed-by: Jason Dillaman <dillaman@redhat.com> Reviewed-by: Kefu Chai <kchai@redhat.com>
| * mgr/MgrClient: close mgr session on daemon MgrClient shutdownSage Weil2018-04-231-0/+25
| | | | | | | | | | | | | | | | | | | | If we are a service daemon, send a MMgrClose on shutdown to clear ourselves out of the ServiceMap. Note that this is a best-effort attempt; we don't block shutdown if the mgr isn't currently available. Signed-off-by: Sage Weil <sage@redhat.com>
* | mgr/MgrClient: service registration filtered by service name instead of ↵runsisi2018-04-171-5/+5
|/ | | | | | daemon name Signed-off-by: runsisi <runsisi@zte.com.cn>
* Merge pull request #20660 from Leeshine/wip-mon-op-trackerKefu Chai2018-03-281-3/+4
|\ | | | | | | | | mon,mgr: make osd_metric more popular and report slow ops to mgr Reviewed-by: Kefu Chai <kchai@redhat.com>
| * mgr,osd: make osd_metric more popularlvshanchun2018-03-281-3/+4
| | | | | | | | Signed-off-by: lvshanchun <lvshanchun@gmail.com>
* | mgr/MgrClient: guard send_pgstats() with lockKefu Chai2018-03-151-6/+12
|/ | | | | | | | | ms_handle_reset() races with send_pgstats(), and the latter could reference a session with a null connection. so we need to guard send_pgstats() with a lock. Fixes: http://tracker.ceph.com/issues/23370 Signed-off-by: Kefu Chai <kchai@redhat.com>
* mgr/MgrClient: only send config_bl if it has changedSage Weil2018-03-061-2/+3
| | | | | | | The mgr already treats the config_bl as optional in the MMgrReport messages. Signed-off-by: Sage Weil <sage@redhat.com>
* mgr: get config defaults on session openSage Weil2018-03-061-0/+1
| | | | | | | Leave them encoded until they are used, since usually we won't use them. This is about 50k currently. Signed-off-by: Sage Weil <sage@redhat.com>
* mgr/MgrClient: report running config to mgrSage Weil2018-03-061-0/+4
| | | | Signed-off-by: Sage Weil <sage@redhat.com>
* mgr: add units to performance countersRubab-Syed2018-02-031-1/+2
| | | | Signed-off-by: Rubab Syed<rubab.syed21@gmail.com>
* mgr: Use unqualified encode/decodeAdam C. Emerson2018-01-101-3/+3
| | | | | | | This is a portion of Part 1 of the namespace project: using ADL properly in encode and decode so we can use namespaces easily in Ceph. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
* mgr/MgrClient: send health_checks using MMgrReportKefu Chai2017-11-211-0/+6
| | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* rados,mgr: pass daemon_status by rvalue referenceKefu Chai2017-10-241-2/+2
| | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* mgr/MgrClient: store registered event returned by add_event_after()Kefu Chai2017-10-241-2/+5
| | | | | | | | | to be consistent with other caller sites of add_event_after(). the original intention of doing so, is to avoid double free of the callback to be added if we are stopping and the timer refuses to add this callback. Signed-off-by: Kefu Chai <kchai@redhat.com>
* mgr/MgrClient: extract MMgrReport sending code into a separated methodKefu Chai2017-10-241-8/+11
| | | | Signed-off-by: Kefu Chai <kchai@redhat.com>
* mgr: respect perf counter prio_adjust in MgrClientJohn Spray2017-09-271-12/+28
| | | | | | | | This awkwardly involves re-ordering some definitions in perf_counters.h in order to refer to the prio names defined in PerfCountersBuilder. Signed-off-by: John Spray <john.spray@redhat.com>
* mgr: transmit perf counter prio to the mgrJohn Spray2017-09-271-0/+1
| | | | Signed-off-by: John Spray <john.spray@redhat.com>
* mgr: remove old-style config opt usageJohn Spray2017-09-181-1/+1
| | | | Signed-off-by: John Spray <john.spray@redhat.com>
* mgr: apply a threshold to perf counter priosJohn Spray2017-08-311-4/+22
| | | | | | | | ...so that we can control the level of load we're putting on ceph-mgr with perf counters. Don't collect anything below PRIO_USEFUL by default. Signed-off-by: John Spray <john.spray@redhat.com>
* common,mds,mgr,mon,osd: store event only if it's addedKefu Chai2017-08-201-5/+6
| | | | | | | | | | | otherwise * we will try to cancel it even it's never been added * we will keep a dangling pointer around. which is, well, scaring. * static analyzer will yell at us: Memory - illegal accesses (USE_AFTER_FREE) Signed-off-by: Kefu Chai <kchai@redhat.com>