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: show the leader info on mon stat command #14178

Merged
merged 1 commit into from Jul 1, 2017

Conversation

Projects
None yet
4 participants
@songbaisen

songbaisen commented Mar 28, 2017

mon: show the leader info on mon stat command

Signed-off-by:song baisen song.baisen@zte.com.cn

songbaisen
mon: show the leader info on mon stat command
Signed-off-by:song baisen <song.baisen@zte.com.cn>
@jecluis

Trivial nits to fix. Other than that, the idea LGTM.

@@ -558,6 +558,9 @@ class Monitor : public Dispatcher,
public:
epoch_t get_epoch();
int get_leader() const { return leader; }
string get_leader_name() {

This comment has been minimized.

@jecluis

jecluis Mar 28, 2017

Member

This should be get_leader_id().

While the MonMap considers each entry as the monitor's name, from the Monitor-class (or ceph-mon's) point of view, a name is in the form of mon.<id>.

And considering MonMap::get_name() will return the id part of the name, this could potentially lead to confusion in the future.

That said, either rename the function to get_leader_id() or have the current function return in the form of mon.<id>.

This comment has been minimized.

@songbaisen

songbaisen Mar 30, 2017

@jecluis Hello! This name just like the below get_quorum_names. If here change may the below name also need to change, that is right?

ss << ", election epoch " << mon->get_epoch() << ", quorum " << mon->get_quorum()
<< " " << mon->get_quorum_names();
ss << ", election epoch " << mon->get_epoch() << ", leader "
<< mon->get_leader() << " " << mon->get_leader_name()

This comment has been minimized.

@jecluis

jecluis Mar 28, 2017

Member

I think it would be nice to return the proper monitor name here, instead of just the monitor's id. I think we want to make sure we get a mon.<id> here instead of just <id>.

@songbaisen

This comment has been minimized.

songbaisen commented Mar 28, 2017

@jecluis Thank you for review. I will change it a little later.

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Apr 14, 2017

@songbaisen ping?

@songbaisen

This comment has been minimized.

songbaisen commented Apr 14, 2017

@tchaikov Done it this afternoon ha! 😄

@songbaisen

This comment has been minimized.

songbaisen commented Apr 14, 2017

@tchaikov @jecluis Hi I am not agree with jecluis change idea. I think the change I do is right. Look below:

[root@tecs01 ~]# ceph mon stat
e6: 4 mons at {192.9.9.61=111.111.111.61:6789/0,192.9.9.62=111.111.111.62:6789/0,192.9.9.63=111.111.111.63:6789/0,192.9.9.64=111.111.111.64:6789/0}, election epoch 56, quorum 0,1,2,3 192.9.9.61,192.9.9.62,192.9.9.63,192.9.9.64
[root@tecs01 ~]# ceph mon_status
{"name":"192.9.9.61","rank":0,"state":"leader","election_epoch":56,"quorum":[0,1,2,3],"outside_quorum":[],"extra_probe_peers":[],"sync_provider":[],"monmap":{"epoch":6,"fsid":"db38c7f7-b271-c991-7365-6adaa56b735f","modified":"2017-03-04 11:16:47.838057","created":"2017-02-23 09:47:25.524612","mons":[{"rank":0,"name":"192.9.9.61","addr":"111.111.111.61:6789\/0"},{"rank":1,"**name**":"192.9.9.62","addr":"111.111.111.62:6789\/0"},{"rank":2,"**name**":"192.9.9.63","addr":"111.111.111.63:6789\/0"},{"rank":3,"**name**":"192.9.9.64","addr":"111.111.111.64:6789\/0"}]}}
@liewegas

This comment has been minimized.

Member

liewegas commented Apr 27, 2017

@jecluis ping

@jecluis

This comment has been minimized.

Member

jecluis commented Jun 27, 2017

Yeah, this looks fine. I would still rather have these functions on the monitor being get_whatever_id() rather than get_whatever_name(), but that's something for another time.

@jecluis jecluis added the needs-qa label Jun 27, 2017

@liewegas liewegas merged commit e4fc5cc into ceph:master Jul 1, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment