Skip to content

osd: Allow repair of an object with a bad data_digest in object_info on all replicas - #23217

Merged
dzafman merged 4 commits into
ceph:masterfrom
dzafman:wip-25085
Jul 31, 2018
Merged

dzafman merged 4 commits into
ceph:masterfrom
dzafman:wip-25085

Conversation

@dzafman

@dzafman dzafman commented Jul 24, 2018 •

Copy link
Copy Markdown
Contributor

@dzafman
dzafman requested a review from liewegas July 25, 2018 17:10
@dzafman
dzafman requested a review from jdurgin July 25, 2018 17:11
@liewegas liewegas changed the title Allow repair of an object with a bad data_digest in object_info on all replicas osd: Allow repair of an object with a bad data_digest in object_info on all replicas Jul 25, 2018
Comment thread src/osd/PGBackend.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fwiw i think the error return is still nicer for the caller. otherwise they have to call ss.str() with constructs a std::string and test it for empty.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the clenaup i'd make is to make the 'error' enum a bool (error = true, error = false), and/or maybe rename 'found_error'.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right I could use the value only to replace the ss.empty() check. This does make me realize that when osd_distrust_data_digest is set and we clear the error the console log will still output the mismatch message that came from be_compare_scrub_objects().

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It probably still makes sense to log a message that the repair happened. Maybe that just means there will be 2 messages, one mismatch, and then another repair message, in the console log?

Comment thread src/tools/ceph_objectstore_tool.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shoudn't this corrupt the data_digest instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The purpose of his change is to have 2 errors, object_info_inconsistency AND data_digest_mismatch_info. That way we see that both kinds of repairs happen during a repair. One uses recovery to fix and the other missing_digest mechanism.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oh i see, and the test is updating the bytes separately via a different cot call. great!

Comment thread src/osd/PGBackend.cc
errorstream << pgid << " shard " << j->first << ": soid " << *k
<< " " << ss.str() << "\n";
} else if (found) {
} else if (object_error.errors != 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

my concern is that, we don't reset object_error before moving to another ScrubMap. so once we identify an error in a certain shard of current object, we will always go to this branch if there is no shard error in succeeding shards. but the reason we go to this branch is not necessary that the object_error.errors is contributed by current shard.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tchaikov Good catch, but will require a follow-on fix. I now realize that we had a bug when I introduced some inconsistency checking in be_select_auth_object(). This change actually improves repair of those inconsistencies at the expense of repairing all shards instead of just the ones that don't match the authoritative shard. This is a result of not resetting object_error.errors.

I had already filed a tracker http://tracker.ceph.com/issues/25108 to cover a logging issue with errors found in be_select_auth_object(). But really I need to move all error checking out of be_select_auth_object() and into be_compare_scrub_objects(). This will fix the logging issue. Then we can return to } else if (found) { which is only needed for logging. At that point the set<pg_shard_t> object_errors can go away if auth_list can't be empty. I'm not totally sure about that yet.

@dzafman dzafman Jul 31, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tchaikov I've got a first cut at restructuring of this code to address your concern and tracker 25108. It'll be in a new pull request.

@dzafman

dzafman commented Jul 31, 2018

Copy link
Copy Markdown
Contributor Author

Test failures appear unrelated
http://pulpito.ceph.com/dzafman-2018-07-30_12:09:07-rados-wip-zafman-testing-distro-basic-smithi/
2839428 deep-scrub stat mismatch, got 0/-1 objects, 0/0 clones, 0/-1 dirty, 0/0 omap, 0/0 pinned, 0/0 hit_set_archive, 0/0 whiteouts 0/-4096 bytes, 0/0 manifest objects, 0/0 hit_set_archive bytes
2839602 AsyncConnection crash

@liewegas

liewegas commented Jul 31, 2018 via email

Copy link
Copy Markdown
Member

@dzafman

dzafman commented Jul 31, 2018

Copy link
Copy Markdown
Contributor Author

@liewegas @jdurgin @tchaikov Let's get this reviewed and merged.

@tchaikov

Copy link
Copy Markdown
Contributor

@dzafman sure, i will re-review it early tomorrow.

@tchaikov tchaikov self-assigned this Jul 31, 2018

@liewegas liewegas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@dzafman
dzafman merged commit 9d06ab3 into ceph:master Jul 31, 2018
@dzafman
dzafman deleted the wip-25085 branch July 31, 2018 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants