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

scrub: do not assign value if read error #6568

Merged
merged 2 commits into from Nov 20, 2015
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/osd/ECBackend.cc
Expand Up @@ -2088,22 +2088,26 @@ void ECBackend::be_deep_scrub(
dout(0) << "_scan_list " << poid << " got "
<< r << " on read, read_error" << dendl;
o.read_error = true;
return;
}

ECUtil::HashInfoRef hinfo = get_hash_info(poid, false);
if (!hinfo) {
dout(0) << "_scan_list " << poid << " could not retrieve hash info" << dendl;
o.read_error = true;
o.digest_present = false;
return;
} else {
if (hinfo->get_chunk_hash(get_parent()->whoami_shard().shard) != h.digest()) {
dout(0) << "_scan_list " << poid << " got incorrect hash on read" << dendl;
o.read_error = true;
return;
}

if (hinfo->get_total_chunk_size() != pos) {
dout(0) << "_scan_list " << poid << " got incorrect size on read" << dendl;
o.read_error = true;
return;
}

/* We checked above that we match our own stored hash. We cannot
Expand Down
4 changes: 3 additions & 1 deletion src/osd/ReplicatedBackend.cc
Expand Up @@ -778,6 +778,7 @@ void ReplicatedBackend::be_deep_scrub(
dout(25) << __func__ << " " << poid << " got "
<< r << " on read, read_error" << dendl;
o.read_error = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could just return in the error case.

return;
}
o.digest = h.digest();
o.digest_present = true;
Expand Down Expand Up @@ -805,6 +806,7 @@ void ReplicatedBackend::be_deep_scrub(
dout(25) << __func__ << " " << poid << " got "
<< r << " on omap header read, read_error" << dendl;
o.read_error = true;
return;
}

ObjectMap::ObjectMapIterator iter = store->get_omap_iterator(
Expand Down Expand Up @@ -832,8 +834,8 @@ void ReplicatedBackend::be_deep_scrub(
dout(25) << __func__ << " " << poid << " got "
<< r << " on omap scan, read_error" << dendl;
o.read_error = true;
return;
}

//Store final calculated CRC32 of omap header & key/values
o.omap_digest = oh.digest();
o.omap_digest_present = true;
Expand Down