From 09a35767fd13e5ba91662e0c2d22e7c811a74bae Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Mon, 1 Aug 2011 17:58:53 -0700 Subject: [PATCH] mdsmon: send commands to all MDSes, not just the in&up ones. Now we can send messages to standbys via broadcast, even if we can't yet single them out. Signed-off-by: Greg Farnum --- src/mon/MDSMonitor.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index bfd94860e2950..be24d0b9e6582 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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 mds_info = mdsmap.get_mds_info(); + for (map::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"; -- 2.39.5