Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/mds: fix MDSMap upgrade decoding #12097

Merged
merged 1 commit into from Nov 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/mds/FSMap.cc
Expand Up @@ -422,6 +422,9 @@ void FSMap::decode(bufferlist::iterator& p)
migrate_fs->mds_map.epoch = epoch;
filesystems[migrate_fs->fscid] = migrate_fs;

// List of GIDs that had invalid states
std::set<mds_gid_t> drop_gids;

// Construct mds_roles, standby_daemons, and remove
// standbys from the MDSMap in the Filesystem.
for (auto &p : migrate_fs->mds_map.mds_info) {
Expand All @@ -431,14 +434,27 @@ void FSMap::decode(bufferlist::iterator& p)
p.second.rank = p.second.standby_for_rank;
}
if (p.second.rank == MDS_RANK_NONE) {
insert(p.second); // into standby_daemons
if (p.second.state != MDSMap::STATE_STANDBY) {
// Old MDSMaps can have down:dne here, which
// is invalid in an FSMap (#17837)
drop_gids.insert(p.first);
} else {
insert(p.second); // into standby_daemons
}
} else {
mds_roles[p.first] = migrate_fs->fscid;
}
}
for (const auto &p : standby_daemons) {
// Erase from this Filesystem's MDSMap, because it has
// been copied into FSMap::Standby_daemons above
migrate_fs->mds_map.mds_info.erase(p.first);
}
for (const auto &gid : drop_gids) {
// Throw away all info for this MDS because it was identified
// as having invalid state above.
migrate_fs->mds_map.mds_info.erase(gid);
}

legacy_client_fscid = migrate_fs->fscid;
} else {
Expand Down