mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
mon: Output the real leader in ::_quorum_status() and get_leader_name()
These functions previously assumed the first mon in the quorum was the leader. That isn't accurate if the first monitor is disallowed or it lost a connectivity-mode election, though. Signed-off-by: Greg Farnum <gfarnum@redhat.com>
This commit is contained in:
parent
0fd65db3de
commit
50351eac6a
@ -2580,7 +2580,7 @@ void Monitor::_quorum_status(Formatter *f, ostream& ss)
|
||||
f->dump_string("mon", *p);
|
||||
f->close_section(); // quorum_names
|
||||
|
||||
f->dump_string("quorum_leader_name", quorum.empty() ? string() : monmap->get_name(*quorum.begin()));
|
||||
f->dump_string("quorum_leader_name", quorum.empty() ? string() : monmap->get_name(leader));
|
||||
|
||||
if (!quorum.empty()) {
|
||||
f->dump_int(
|
||||
|
@ -582,7 +582,7 @@ public:
|
||||
epoch_t get_epoch();
|
||||
int get_leader() const { return leader; }
|
||||
std::string get_leader_name() {
|
||||
return quorum.empty() ? std::string() : monmap->get_name(*quorum.begin());
|
||||
return quorum.empty() ? std::string() : monmap->get_name(leader);
|
||||
}
|
||||
const std::set<int>& get_quorum() const { return quorum; }
|
||||
std::list<std::string> get_quorum_names() {
|
||||
|
Loading…
Reference in New Issue
Block a user