]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: enable standby_for_fscid without rank 8257/head
authorJohn Spray <john.spray@redhat.com>
Tue, 22 Mar 2016 11:54:24 +0000 (11:54 +0000)
committerJohn Spray <john.spray@redhat.com>
Tue, 22 Mar 2016 12:08:49 +0000 (12:08 +0000)
...so that an MDS can specify that it wants
to act within a particular filesystem without
having to be bound to a particular rank.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/FSMap.cc

index 9b79bc3f7c29e28c5cad9a33be2c62113a657748..550f5c5e3a9a643db50c437d6b4c6f4f2291c909 100644 (file)
@@ -477,10 +477,14 @@ mds_gid_t FSMap::find_standby_for(mds_role_t role, const std::string& name) cons
         || (name.length() && info.standby_for_name == name)) {
       // It's a named standby for *me*, use it.
       return gid;
-    } else if (info.standby_for_rank < 0 && info.standby_for_name.length() == 0)
-      // It's not a named standby for anyone, use it if we don't find
-      // a named standby for me later.
-      result = gid;
+    } else if (
+        info.standby_for_rank < 0 && info.standby_for_name.length() == 0 &&
+        (info.standby_for_fscid == FS_CLUSTER_ID_NONE ||
+         info.standby_for_fscid == role.fscid)) {
+        // It's not a named standby for anyone, use it if we don't find
+        // a named standby for me later, unless it targets another FSCID.
+        result = gid;
+      }
   }
 
   return result;