summaryrefslogtreecommitdiffstats
path: root/src/ceph_mgr.cc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* common: cache pthread namesPatrick Donnelly2024-10-251-1/+1
| | | | | | | | | | | | | This provides common ceph entrypoints for the pthread_[gs]name functions which will also cache a thread_local copy. This also removes the pthread_t parameter which precipitated the bug i50743. Obviously, the overall goal here is to avoid system calls. See-also: https://tracker.ceph.com/issues/50743 Fixes: 0be8d01c9ddde0d7d24edd34dc75f6cfc861b5ba Fixes: https://tracker.ceph.com/issues/68691 Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
* common: modify 'main()s' to use new argv_to_vec() signatureRonen Friedman2021-08-191-2/+1
| | | | | | | A followup to PR #42820 that modified argv_to_vec() signature (for style and performance). Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
* mgr: build without "using namespace std"Kefu Chai2021-08-131-5/+5
| | | | | | | | | | * add "std::" prefix in headers * add "using" declarations in .cc files. so we don't rely on "using namespace std" in one or more included headers. Signed-off-by: Kefu Chai <kchai@redhat.com>
* common: remove data_dir_option in func global_initChangcheng Liu2020-09-091-2/+1
| | | | | | | | 1. data_dir_option isn't used 2. Align with commit 85f2315b: "remove data_dir_option from common_preinit and global_pre_init" Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
* ceph-mgr: exit after usageSage Weil2018-04-131-0/+1
| | | | Signed-off-by: Sage Weil <sage@redhat.com>
* global: output usage on -h, --help, or no args before contacting monsSage Weil2018-03-151-6/+7
| | | | | | | | | | | | - when there are no arguments, print a short invitation to stderr to use -h or --help and exit with an error. - if we get -h or --help, print usage to stdout, and exit with success. - do the above *before* making any contact with the cluster. we should not fail to explain usage because the mons are down. - if there is some other error with the arguments, print an error message, but do not spam the user with usage. Try to use cerr instead of derr. Signed-off-by: Sage Weil <sage@redhat.com>
* drop unnecessary env_to_vec callsSage Weil2018-03-061-1/+0
| | | | | | global[_pre]_init does this for us now. Signed-off-by: Sage Weil <sage@redhat.com>
* mon/MonClient: one-shot mon connection on started to fetch configSage Weil2018-03-061-4/+6
| | | | | | | | | | | | | | This is not particularly efficient, but it works: - connect to the monitor to get the monmap and config - tear it all down - proceed with normal startup (which presumably involves reconnecting to the mon all over again). This allows us to set config options that may affect the mon communication itself, like ms_type. Signed-off-by: Sage Weil <sage@redhat.com>
* mgr: set explicit thread nameJohn Spray2017-09-151-0/+5
| | | | | | | | | This gets used as our process name in some situations when respawning. This is the same as what commit 4f177bb6b did for the MDS. Fixes: http://tracker.ceph.com/issues/21404 Signed-off-by: John Spray <john.spray@redhat.com>
* mgr: add missing call to pick_addressesJohn Spray2017-08-091-0/+3
| | | | | | | | Previously this was presumably simply not applying the public_network setting at all. Fixes: http://tracker.ceph.com/issues/20955 Signed-off-by: John Spray <john.spray@redhat.com>
* mgr: tighten initialization of keyring settingJohn Spray2017-07-211-1/+1
| | | | | | | | | We should not proceed if setting this fails. Also the meta=false setting is not what you want when calling into set_val after initialization, I'm not sure how that ever worked! Signed-off-by: John Spray <john.spray@redhat.com>
* mgr/MgrStandby: respawn when deactivatedSage Weil2017-06-071-1/+1
| | | | | | | | | | | | | - It is ugly to unwind all of the Mgr state so that we can reactivate later. - It is perhaps impossible to do shut down the python state reliably. - Respawning provides a clean state and is reliable. This mostly just copies MDSServer::respawn(). Fixes: http://tracker.ceph.com/issues/19595 Fixes: http://tracker.ceph.com/issues/19549 Signed-off-by: Sage Weil <sage@redhat.com>
* mgr: add generic --help outputTim Serong2017-05-191-3/+7
| | | | | | | | | | | | | | Creating an MgrStandby in order to call its usage() method has two problems: 1) MgrStandby wants to connect to a running cluster; if the cluster isn't up, you'll be left staring at a blinking cursor. 2) MgrStandby::usage() doesn't print anything anyway. This commit takes pretty much the same approach to printing usage information as ceph_mon.cc, ceph_osd.cc and ceph_mds.cc. Signed-off-by: Tim Serong <tserong@suse.com>
* ceph-mgr: threads after forkSage Weil2017-03-291-2/+2
| | | | | | | MgrStandby contains an Objecter with a ceph_timer and associated thread. Create it after we fork. Signed-off-by: Sage Weil <sage@redhat.com>
* common,test: g_ceph_context->put() upon returnKefu Chai2016-11-241-2/+3
| | | | | | | | | | | | | | | | | | | | | prior to this change, global_init() could create a new CephContext and assign it to g_ceph_context. it's our responsibilty to release the CephContext explicitly using cct->put() before the application quits. but sometimes, we fail to do so. in this change, global_init() will return an intrusive_ptr<CephContext>, which calls `g_ceph_context->put()` in its dtor. this ensures that the CephContext is always destroyed before main() returns. so the log is flushed before _log_exp_length is destroyed. there are two cases where global_pre_init() is called directly. - ceph_conf.cc: g_ceph_context->put() will be called by an intrusive_ptr<> deleter. - rgw_main.cc: global_init() is called later on on the success code path, so it will be taken care of. Fixes: http://tracker.ceph.com/issues/17762 Signed-off-by: Kefu Chai <kchai@redhat.com>
* mgr: handle PGStats with a PGMapJohn Spray2016-09-291-0/+1
| | | | | | | No longer need the mon to send us the pg_summary json hack. Signed-off-by: John Spray <john.spray@redhat.com>
* mgr: flesh out standby/HAJohn Spray2016-09-291-7/+7
| | | | Signed-off-by: John Spray <john.spray@redhat.com>
* mgr: enable multiple python modulesJohn Spray2016-09-291-8/+3
| | | | | | | serve() each one in a separate thread, include a shutdown() hook so that we can tear down cleanly. Signed-off-by: John Spray <john.spray@redhat.com>
* mgr: create ceph-mgr serviceJohn Spray2016-09-291-0/+67
Signed-off-by: John Spray <john.spray@redhat.com>