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

mon: add mgr metdata commands, and overall 'versions' command for all daemon versions #16460

Merged
merged 8 commits into from Jul 22, 2017

Conversation

Projects
None yet
2 participants
@liewegas
Copy link
Member

liewegas commented Jul 20, 2017

$ ceph versions
{
    "mon": {
        "ceph version 12.1.1-235-g9c3232d (9c3232d4c9375963f7f5f6c04b035788a13c0b79) luminous (rc)": 1
    },
    "mgr": {
        "ceph version 12.1.1-233-g1b51c63 (1b51c63d72ec10fd176af672e9cca7a85226021e) luminous (rc)": 2
    },
    "osd": {
        "ceph version 12.1.1-233-g1b51c63 (1b51c63d72ec10fd176af672e9cca7a85226021e) luminous (rc)": 1
    },
    "mds": {
        "ceph version 12.1.1-235-g9c3232d (9c3232d4c9375963f7f5f6c04b035788a13c0b79) luminous (rc)": 1
    },
    "rgw": {
        "ceph version 12.1.1-233-g1b51c63 (1b51c63d72ec10fd176af672e9cca7a85226021e) luminous (rc)": 1
    },
    "overall": {
        "ceph version 12.1.1-233-g1b51c63 (1b51c63d72ec10fd176af672e9cca7a85226021e) luminous (rc)": 4,
        "ceph version 12.1.1-235-g9c3232d (9c3232d4c9375963f7f5f6c04b035788a13c0b79) luminous (rc)": 2
    }
}

@liewegas liewegas added this to the luminous milestone Jul 20, 2017

@liewegas liewegas requested a review from tchaikov Jul 20, 2017

@tchaikov
Copy link
Contributor

tchaikov left a comment

lgtm in general aside from the nits. but we do need to add FIXME to release-notes.txt, so we don't forget amending the manpage before the official release.

@@ -42,10 +43,11 @@ class MMgrBeacon : public PaxosServiceMessage {

MMgrBeacon(const uuid_d& fsid_, uint64_t gid_, const std::string &name_,
entity_addr_t server_addr_, bool available_,
const std::set<std::string>& module_list)
const std::set<std::string>& module_list,
const map<string,string>& metadata)

This comment has been minimized.

Copy link
@tchaikov

tchaikov Jul 21, 2017

Contributor

could pass by rvalue reference.

@@ -55,6 +57,7 @@ class MMgrBeacon : public PaxosServiceMessage {
const std::string& get_name() const { return name; }
const uuid_d& get_fsid() const { return fsid; }
std::set<std::string>& get_available_modules() { return available_modules; }
const std::map<std::string,std::string>& get_metadata() { return metadata; }

This comment has been minimized.

Copy link
@tchaikov

tchaikov Jul 21, 2017

Contributor

and mark this method const also.

MMgrBeacon *m = new MMgrBeacon(monc.get_fsid(),
monc.get_global_id(),
g_conf->name.get_id(),
addr,
available,
modules);
modules,
metadata);

This comment has been minimized.

Copy link
@tchaikov

tchaikov Jul 21, 2017

Contributor

could pass by rvalue reference.

@@ -94,6 +94,11 @@ class MgrMonitor: public PaxosService

void print_summary(Formatter *f, std::ostream *ss) const;

int load_metadata(string name, std::map<string, string>& m,

This comment has been minimized.

Copy link
@tchaikov

tchaikov Jul 21, 2017

Contributor

nit, const string& name, might want to pass m using pointer. as it is an output parameter.

@@ -158,10 +158,12 @@ Major Changes from Kraken
* *CLI changes*:

- The ``ceph -s`` or ``ceph status`` command has a fresh look.
- ``ceph {osd,mds,mon} versions`` summarizes versions of running daemons.
- ``ceph {osd,mds,mon} count-metadata <property>`` similarly
- ``ceph mgr metadata`` will dump metadata associated with each mgr

This comment has been minimized.

Copy link
@tchaikov

tchaikov Jul 21, 2017

Contributor

add FIXME, if we plan to fix the man page later on.

This comment has been minimized.

Copy link
@liewegas

liewegas Jul 21, 2017

Author Member

updated man page

<< " active";
return ss.str();
}

void count_metadata(const string& field,
std::map<std::string,int> *out) const {

This comment has been minimized.

Copy link
@tchaikov

tchaikov Jul 21, 2017

Contributor

nit, s/int/unsigned/

@@ -428,6 +428,9 @@ class OSDMonitor : public PaxosService {

int load_metadata(int osd, map<string, string>& m, ostream *err);
void count_metadata(const string& field, Formatter *f);
public:
void count_metadata(const string& field, map<string,int> *out);
protected:

This comment has been minimized.

Copy link
@tchaikov

tchaikov Jul 21, 2017

Contributor

nit, do we want to inherit from OSDMonitor?

This comment has been minimized.

Copy link
@liewegas

liewegas Jul 21, 2017

Author Member

I'm pretty unhappy about the duplication of hte metadata code across all teh *Monitor classes but factoring it out is a non-trivial cleanup due to a few inconsistencies. Kicking that can down the road...

@liewegas liewegas force-pushed the liewegas:wip-mgr-metadata branch from 972265f to 0cc2bb4 Jul 21, 2017

liewegas added some commits Jul 20, 2017

mon/MgrMonitor: store mgr daemon metadata
Signed-off-by: Sage Weil <sage@redhat.com>
mon: factor out count_metadata w/ counter helper
Signed-off-by: Sage Weil <sage@redhat.com>
mon: 'versions' command to show running versions for daemons of all t…
…ypes

Easier!

Signed-off-by: Sage Weil <sage@redhat.com>
mgr/ServiceMap: fix typo in service status summary
Signed-off-by: Sage Weil <sage@redhat.com>
qa/workunits/cephtool/test.sh: add a few tests
Signed-off-by: Sage Weil <sage@redhat.com>
mgr: use rvalue ref for MMgrBeacon metadata
Signed-off-by: Sage Weil <sage@redhat.com>
doc/man/8/ceph: document 'ceph mgr *' commands
Signed-off-by: Sage Weil <sage@redhat.com>

@liewegas liewegas force-pushed the liewegas:wip-mgr-metadata branch from 0cc2bb4 to 7d59d0d Jul 21, 2017

@liewegas

This comment has been minimized.

Copy link
Member Author

liewegas commented Jul 21, 2017

updated and rebased

@liewegas liewegas merged commit 0429acd into ceph:master Jul 22, 2017

3 of 4 checks passed

make check make check failed
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check (arm64) make check succeeded
Details

@liewegas liewegas deleted the liewegas:wip-mgr-metadata branch Jul 22, 2017

@Liuchang0812 Liuchang0812 referenced this pull request Jul 22, 2017

Closed

Mgr versions #4

3 of 8 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.