diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 08e0cbf7d09..1bb7b171370 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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( diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index b6f6e517dfe..19dff639bae 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -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& get_quorum() const { return quorum; } std::list get_quorum_names() {