pending_fsmap.legacy_client_fscid : info.standby_for_fscid,
info.standby_for_rank};
+ // It is possible that the map contains a standby_for_fscid
+ // that doesn't correspond to an existing filesystem, especially
+ // if we loaded from a version with a bug (#17466)
+ if (info.standby_for_fscid != FS_CLUSTER_ID_NONE
+ && pending_fsmap.get_filesystems().count(
+ info.standby_for_fscid) == 0) {
+ derr << "gid " << gid << " has invalid standby_for_fscid "
+ << info.standby_for_fscid << dendl;
+ continue;
+ }
+
// If we managed to resolve a full target role
if (target_role.fscid != FS_CLUSTER_ID_NONE) {
auto fs = pending_fsmap.get_filesystem(target_role.fscid);