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

crush: detect and (usually) fix ruleset != rule id #13683

Merged
merged 14 commits into from Jun 21, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+17 −0
Diff settings

Always

Just for now

mon/OSDMonitor: automatically convert crushmap if ruleset != rule id

Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information...
liewegas committed Feb 28, 2017
commit 4f24d63f58a74376725ec12de429cbd3ceab7b8a
@@ -544,6 +544,23 @@ void OSDMonitor::on_active()
void OSDMonitor::on_restart()
{
last_osd_report.clear();

if (mon->is_leader()) {
// fix ruleset != ruleid
if (osdmap.crush->has_legacy_rulesets() &&
!osdmap.crush->has_multirule_rulesets()) {
CrushWrapper newcrush;
_get_pending_crush(newcrush);
int r = newcrush.renumber_rules_by_ruleset();
if (r >= 0) {
dout(1) << __func__ << " crush map has ruleset != rule id; fixing" << dendl;
pending_inc.crush.clear();
newcrush.encode(pending_inc.crush, mon->get_quorum_con_features());
} else {
dout(10) << __func__ << " unable to renumber rules by ruleset" << dendl;
}
}
}
}

void OSDMonitor::on_shutdown()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.