]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mdsmon: send commands to all MDSes, not just the in&up ones.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Tue, 2 Aug 2011 00:58:53 +0000 (17:58 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Tue, 2 Aug 2011 00:59:23 +0000 (17:59 -0700)
Now we can send messages to standbys via broadcast, even if we
can't yet single them out.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mon/MDSMonitor.cc

index bfd94860e29501b3f44975c6a3294faf7707c4cc..be24d0b9e6582d06fd26c0470387f05dfb136cfb 100644 (file)
@@ -540,11 +540,12 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
       if (m->cmd[0] == "*") {
        m->cmd.erase(m->cmd.begin()); //and now we're done with the target num
        r = -ENOENT;
-       for (unsigned i = 0; i < mdsmap.get_max_mds(); ++i) {
-         if (mdsmap.is_active(i)) {
-           mon->send_command(mdsmap.get_inst(i), m->cmd, paxos->get_version());
-           r = 0;
-         }
+       const map<uint64_t, MDSMap::mds_info_t> mds_info = mdsmap.get_mds_info();
+       for (map<uint64_t, MDSMap::mds_info_t>::const_iterator i = mds_info.begin();
+            i != mds_info.end();
+            ++i) {
+         mon->send_command(i->second.get_inst(), m->cmd, paxos->get_version());
+         r = 0;
        }
        if (r == -ENOENT) {
          ss << "no mds active";