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

osd: avoid FORCE updating digest been overwritten by MAYBE when comparing scrub map #7051

Merged
merged 2 commits into from Feb 24, 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
24 changes: 13 additions & 11 deletions src/osd/PGBackend.cc
Expand Up @@ -635,6 +635,19 @@ void PGBackend::be_compare_scrubmaps(
FORCE = 2,
} update = NO;

if (auth_object.digest_present && auth_object.omap_digest_present &&
(!auth_oi.is_data_digest() || !auth_oi.is_omap_digest())) {
dout(20) << __func__ << " missing digest on " << *k << dendl;
update = MAYBE;
}
if (auth_object.digest_present && auth_object.omap_digest_present &&
g_conf->osd_debug_scrub_chance_rewrite_digest &&
(((unsigned)rand() % 100) >
g_conf->osd_debug_scrub_chance_rewrite_digest)) {
dout(20) << __func__ << " randomly updating digest on " << *k << dendl;
update = MAYBE;
}

// recorded digest != actual digest?
if (auth_oi.is_data_digest() && auth_object.digest_present &&
auth_oi.data_digest != auth_object.digest) {
Expand All @@ -657,17 +670,6 @@ void PGBackend::be_compare_scrubmaps(
update = FORCE;
}

if (auth_object.digest_present && auth_object.omap_digest_present &&
(!auth_oi.is_data_digest() || !auth_oi.is_omap_digest())) {
dout(20) << __func__ << " missing digest on " << *k << dendl;
update = MAYBE;
}
if (g_conf->osd_debug_scrub_chance_rewrite_digest &&
(((unsigned)rand() % 100) >
g_conf->osd_debug_scrub_chance_rewrite_digest)) {
dout(20) << __func__ << " randomly updating digest on " << *k << dendl;
update = MAYBE;
}
if (update != NO) {
utime_t age = now - auth_oi.local_mtime;
if (update == FORCE ||
Expand Down