Repository navigation
common/io_exerciser: Add consistency checking functionality to IO exerciser - #62985
Conversation
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
JonBailey1993
left a comment
There was a problem hiding this comment.
Only commented on latest commit as it looks like previous commits are covered in your dependent PR
There was a problem hiding this comment.
This should probably be below the barrier, so you can specify barrier and consistency together without workarounds in those cases (although I guess that introduces workarounds in the cases where you specify it together with remove...)
There was a problem hiding this comment.
You've edited almost every sequence to do a check for consistency before a remove. I wonder instead of having a consistency=true that you have to set in every sequence if it would be better to just check for check_consistency within the if (remove) or in increment_object_size(). (I think this is the point you are trying to check for consistency in existing things, but it looks like there are a couple where you are checking after every write in which case maybe its useful having this consistency flag you can set as well).
I'm just thinking out loud if there is a way to support consistency checking so that it will apply to new sequences that are added without having to manually know to add support and check for the flag, etc. Not sure I've given the perfect solution though as maybe its not clear to sequence developers they are getting that extra check then however.
There was a problem hiding this comment.
From memory I did have some trouble fitting the consistency checking into the existing logic in a way that didn't result in loads of duplicate barriers etc, but I agree this would be better if I can get it to work. I'll give it another go!
e4f0a02 to
c78edbd
Compare
|
@JonBailey1993 I’ve made some changes based on previous discussion. After giving it some thought I think this approach makes sense but let me know if you disagree. Any time we do a remove we will always check consistency pre-remove if consistency checking Is enabled. Sequence writers will get that for free without having to worry about it. For writes, sequence writers will still have to decide when to perform a consistency check. My understanding is that we don’t want to do a consistency check after every write, as some sequences are testing things like multiple concurrent writes, doing barrier consistency checks in-between these would invalidate these kinds of tests. I thought about adding a write wrapper function that does a consistency check which can be called in cases where we want to check consistency after a write, but it didn’t really fit into the logic of the existing sequences where we mostly want to check consistency on the next loop after a write when doneread and donebarrier are set. The upshot is that the changes I’ve made will make it simpler for sequence developers to add in consistency checks after writes without having to worry about workarounds for getting the barriers right in most cases. |
JonBailey1993
left a comment
There was a problem hiding this comment.
I agree with the approach and think it sounds good. I've had a look through the changes and the code looks good to me, just one query on chunk_size which I'm curious about. Looks good to me though.
There was a problem hiding this comment.
How will the consistency checker react if it gets a chunk_size of 0?
There was a problem hiding this comment.
So I've had a bit more of a think about this line here (and the matching line for interactive mode).
So we should be able to assume the getProfile()->chunk_size values exists as long as:
a) the pool was generated by the IO sequence exerciser (not if they are precreated and passed in with the --pool flag)
b) we are not doing a dryrun
This means we can remove the guessing for the chunk size (value_or(...)) if we remove these two possibilities.
For point (a), there is a couple of options.
- You can modify SelectErasureProfile::selectExistingProfile to also retrieve the chunk_size of the created pool through a rest request (you might have to modify one of the ceph::messaging::json::osd structures to include chunk_size or add a new structure to retrieve it.
- Alternatively a much easier solution might be to add to the "checkconsistency" flag to the "disallowed_options" array in the SelectErasurePool() constructor, which give an error to the user if you supply them together.
As for dryrun, both this and the other place you are retrieving the chunk size are in the else statement of an if (dryrun), so you are safe to assume that we are not doing a dry run when we want to get the chunk size at these points, which means we can assume the profile does exist (This is what happens with km/mapping & layers above as well, where we assume if we aren't doing a dry run then one of these two options has to exist).
This should mean if you do (1) or (2) to solve (a) then you should be able to take out the value_or(4096) from both places, as it should be guaranteed the profile exists and has a chunk size. If you want to be double-y sure you can add a ceph_assert(spo.getProfile()) and ceph_assert(spo.getProfile()->chunk_size) prior to calling them and then if I'm wrong then the core dumps should give a good indication of what has gone wrong for the profile to be missing when it shouldn't be.
There was a problem hiding this comment.
I've added a new commit which has the consistency checker get the chunk size from the pool's profile which gets rid of the need for the IO exerciser to guess the chunk size (and means we don't need to have chunk size as a CLI argument for the consistency checker anymore).
I've snuck that extra commit in here, let me know what you think.
There was a problem hiding this comment.
Looks good to me :-)
There was a problem hiding this comment.
nit: wonder if these variables might be more clear with names such as consistency_in_progress/consistency_request_sent and done_consistency, as currently done_consistency is true before it is done if I'm understanding this right.
Logically this all looks sound and I won't hold back merging over it.
c78edbd to
e8b065b
Compare
|
jenkins test make check arm64 |
…mmand line arg Signed-off-by: Connor Fawcett <[email protected]>
checking during IO sequences (disabled by default). Signed-off-by: Connor Fawcett <[email protected]>
e8b065b to
eb6278e
Compare
Depends on: #62170
This PR integrates the consistency checker with the IO exerciser to allow live consistency checking of objects as IO is being performed. A new op type ‘consistency’ has been added and the existing sequences have been updated to perform a consistency check at appropriate times, mainly when a read is done after a write or series of writes, or just before an object is deleted. This new behaviour is guarded behind a flag (—checkconsistency), the default behaviour is unchanged and the exerciser behaviour should not be changed when the flag is not specified.
Only the latest commit (e4f0a02fe0ba91166e68a210ea69d0329833fa50) is part of this PR, previous commits will go in as part of 62170.
Signed-off-by: Connor Fawcett [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition