Skip to content

Commit

Permalink
osd: move recorded vs on disk digest warning into be_compare_scrubmaps
Browse files Browse the repository at this point in the history
This is a better place for it.  While we are here, change the wording to
clearly call out the 'recorded' digest (from object_info_t) vs the 'on
disk' digest (what we observed during scrub).

Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Apr 7, 2015
1 parent e34d31b commit cf349ff
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 33 deletions.
53 changes: 40 additions & 13 deletions src/osd/PGBackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -628,21 +628,48 @@ void PGBackend::be_compare_scrubmaps(
if (!cur_inconsistent.empty() || !cur_missing.empty()) {
authoritative[*k] = auth_list;
}
if (clean &&
okseed &&
parent->get_pool().is_replicated() &&
auth_object.digest_present && auth_object.omap_digest_present &&
(!auth_oi.is_data_digest() || !auth_oi.is_omap_digest() ||
(g_conf->osd_debug_scrub_chance_rewrite_digest &&

if (okseed &&
clean &&
parent->get_pool().is_replicated()) {
enum {
NO = 0,
MAYBE = 1,
FORCE = 2,
} update = NO;

// recorded digest != actual digest?
if (auth_oi.is_data_digest() && auth_object.digest_present &&
auth_oi.data_digest != auth_object.digest) {
++deep_errors;
errorstream << __func__ << ": " << pgid << " recorded data digest 0x"
<< std::hex << auth_oi.data_digest << " != on disk 0x"
<< auth_object.digest << std::dec << " on " << auth_oi.soid;
}
if (auth_oi.is_omap_digest() && auth_object.omap_digest_present &&
auth_oi.omap_digest != auth_object.omap_digest) {
++deep_errors;
errorstream << __func__ << ": " << pgid << " recorded omap digest 0x"
<< std::hex << auth_oi.data_digest << " != on disk 0x"
<< auth_object.digest << std::dec << " on " << auth_oi.soid;
}

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)))) {
if (!cur_inconsistent.empty() || !cur_missing.empty()) {
dout(20) << __func__ << " not updating oi digest on "
<< *k << " since it is inconsistent" << dendl;
} else {
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 (age > g_conf->osd_deep_scrub_update_digest_min_age) {
dout(20) << __func__ << " noting missing digest on " << *k << dendl;
if (update == FORCE ||
age > g_conf->osd_deep_scrub_update_digest_min_age) {
dout(20) << __func__ << " will update digest on " << *k << dendl;
missing_digest[*k] = make_pair(auth_object.digest,
auth_object.omap_digest);
} else {
Expand Down
20 changes: 0 additions & 20 deletions src/osd/ReplicatedPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11228,26 +11228,6 @@ void ReplicatedPG::_scrub(

dout(20) << mode << " " << soid << " " << oi << dendl;

if (pool.info.is_replicated() &&
(get_min_peer_features() & CEPH_FEATURE_OSD_OBJECT_DIGEST)) {
if (oi.is_data_digest() && p->second.digest_present &&
oi.data_digest != p->second.digest) {
osd->clog->error() << mode << " " << info.pgid << " " << soid
<< " on disk data digest 0x" << std::hex
<< p->second.digest << " != 0x"
<< oi.data_digest << std::dec;
++scrubber.deep_errors;
}
if (oi.is_omap_digest() && p->second.omap_digest_present &&
oi.omap_digest != p->second.omap_digest) {
osd->clog->error() << mode << " " << info.pgid << " " << soid
<< " on disk omap digest 0x" << std::hex
<< p->second.omap_digest << " != 0x"
<< oi.omap_digest << std::dec;
++scrubber.deep_errors;
}
}

if (soid.is_snap()) {
stat.num_bytes += snapset.get_clone_bytes(soid.snap);
} else {
Expand Down

0 comments on commit cf349ff

Please sign in to comment.