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

mon/MDSMonitor: wait for readable OSDMap before sanitizing #18603

Merged
merged 1 commit into from
Oct 30, 2017
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
7 changes: 5 additions & 2 deletions src/mon/MDSMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ void MDSMonitor::update_from_paxos(bool *need_bootstrap)
assert(fsmap_bl.length() > 0);
dout(10) << __func__ << " got " << version << dendl;
fsmap.decode(fsmap_bl);
auto &osdmap = mon->osdmon()->osdmap;
fsmap.sanitize([&osdmap](int64_t pool){return osdmap.have_pg_pool(pool);});

// new map
dout(4) << "new map" << dendl;
Expand All @@ -140,6 +138,11 @@ void MDSMonitor::create_pending()
pending_fsmap = fsmap;
pending_fsmap.epoch++;

if (mon->osdmon()->is_readable()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you have concern about the ordering in which osdmap is updated and mdsmap is updated, asPAXOS_MDSMAP < PAXOS_OSDMAP. probably you can do this in post_paxos_update() where all paxos services have been refreshed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that ensures a valid osdmap, but we still shouldn't touch the fsmap. the change should be applied to pending_fsmap, which means it goes in create_pending or encode_pending

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, agreed.

auto &osdmap = mon->osdmon()->osdmap;
pending_fsmap.sanitize([&osdmap](int64_t pool){return osdmap.have_pg_pool(pool);});
}

dout(10) << "create_pending e" << pending_fsmap.epoch << dendl;
}

Expand Down