]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix standby-replay assignment (again)
authorSage Weil <sage@newdream.net>
Tue, 26 Apr 2011 22:44:56 +0000 (15:44 -0700)
committerSage Weil <sage@newdream.net>
Tue, 26 Apr 2011 22:44:56 +0000 (15:44 -0700)
Only assign a random node to standby-replay if they are marked as
STANDBY_ANY.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/MDSMonitor.cc

index 51d5a0bfd1708ed88651d15d304b514ef09dc2f9..f6e3aefce8d8aae157baa48d3fb96e9aac16aa8a 100644 (file)
@@ -1067,11 +1067,12 @@ void MDSMonitor::tick()
           i != pending_mdsmap.mds_info.end();
           ++i) {
        if (i->second.rank >= 0 && pending_mdsmap.is_followable(i->second.rank)) {
-         if (info.standby_for_name.length() &&
-             info.standby_for_name != i->second.name)
+         if ((info.standby_for_name.length() && info.standby_for_name != i->second.name) ||
+             info.standby_for_rank >= 0)
            continue;   // we're supposed to follow someone else
 
-         if (try_standby_replay(info, i->second)) {
+         if (info.standby_for_rank == MDSMap::MDS_STANDBY_ANY &&
+             try_standby_replay(info, i->second)) {
            do_propose = true;
            break;
          }