]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: make quorum list (by name) be in quorum order 1379/head
authorSage Weil <sage@inktank.com>
Wed, 5 Mar 2014 22:28:49 +0000 (14:28 -0800)
committerSage Weil <sage@inktank.com>
Wed, 5 Mar 2014 22:29:02 +0000 (14:29 -0800)
Fixes: #7562
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index 64e7f3f3fd7cb2f90c1b59d99631b793c9c74645..5697d0e97a5d1b0c12240eb4f8a06e2ddbfb5af3 100644 (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);
index 30f117d90886e1ef93ce3e6e83c6a318f170f548..e8828a1646448a57b2cbfc805c05ce672e80b9b2 100644 (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 {