Skip to content

Commit

Permalink
mds: enable standby_for_fscid without rank
Browse files Browse the repository at this point in the history
...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>
  • Loading branch information
John Spray committed Mar 22, 2016
1 parent 93d6c86 commit ad0ad2d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/mds/FSMap.cc
Expand Up @@ -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;
Expand Down

0 comments on commit ad0ad2d

Please sign in to comment.