Merge pull request #1379 from ceph/wip-7562

mon: make quorum list (by name) be in quorum order

Reviewed-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
Gregory Farnum 2014-03-06 10:44:42 -08:00
commit aa7945abc8
2 changed files with 6 additions and 6 deletions

View File

@ -1717,9 +1717,9 @@ void Monitor::_quorum_status(Formatter *f, ostream& ss)
f->dump_int("mon", *p);
f->close_section(); // quorum
set<string> quorum_names = get_quorum_names();
list<string> quorum_names = get_quorum_names();
f->open_array_section("quorum_names");
for (set<string>::iterator p = quorum_names.begin(); p != quorum_names.end(); ++p)
for (list<string>::iterator p = quorum_names.begin(); p != quorum_names.end(); ++p)
f->dump_string("mon", *p);
f->close_section(); // quorum_names
@ -1975,7 +1975,7 @@ void Monitor::get_status(stringstream &ss, Formatter *f)
ss << " cluster " << monmap->get_fsid() << "\n";
ss << " health " << health << "\n";
ss << " monmap " << *monmap << ", election epoch " << get_epoch()
<< ", quorum " << get_quorum() << " " << get_quorum_names() << "\n";
<< ", quorum " << get_quorum() << " " << get_quorum_names() << "\n";
if (mdsmon()->mdsmap.get_epoch() > 1)
ss << " mdsmap " << mdsmon()->mdsmap << "\n";
osdmon()->osdmap.print_summary(NULL, ss);

View File

@ -516,10 +516,10 @@ public:
epoch_t get_epoch();
int get_leader() { return leader; }
const set<int>& get_quorum() { return quorum; }
set<string> get_quorum_names() {
set<string> q;
list<string> get_quorum_names() {
list<string> q;
for (set<int>::iterator p = quorum.begin(); p != quorum.end(); ++p)
q.insert(monmap->get_name(*p));
q.push_back(monmap->get_name(*p));
return q;
}
uint64_t get_quorum_features() const {