Repository navigation
osd: Allow multiple objects with same version in missing list. - #68284
Conversation
d9ea30a to
6b98146
Compare
6b98146 to
38d3734
Compare
bill-scales
left a comment
There was a problem hiding this comment.
- Crimson code doesn't compile
- I think rmissing_insert_allow_duplicate_version should be idempotent
- I'm not a fan of having insert/insert_allow_duplicate_version and add/add_allow_duplicate_version. I think you'll get more bugs from the wrong version being called than you'll get protection from worrying about the missing list having different objects with the same version. As a case in point I think PeeringState::force_object_missing is using the wrong version of add.
| if (it != rmissing.end() && it->first == version) { | ||
| auto range = rmissing.equal_range(version); | ||
| for (auto check_it = range.first; check_it != range.second; ++check_it) { | ||
| ceph_assert(check_it->second != object); // Duplicate OID not allowed |
There was a problem hiding this comment.
Previously the code was idempotent and allowed the same {version,oid} to be inserted multiple times. I think you want to change this to just skip the insert (don't want multiple identical entries in the multimap) rather than assert
| } | ||
|
|
||
| // Insert a version-to-object mapping. | ||
| void rmissing_insert( |
There was a problem hiding this comment.
I'm not a fan of having rmissing_insert and rmissing_insert_allow_duplicate_version. I don't think the extra assert is worth the risk of calling the wrong version of the function. It's not easy to work out whether the missing object that is being updated has a log entry (and hence must not have a duplicate version) or doesn't (in which case you must allow for duplicate entries).
There was a problem hiding this comment.
Agreed - I have removed rmissing_insert_allow_duplicate_version and moved its functionality to rmissing_insert
38d3734 to
db41803
Compare
| ChangeTracker<TrackChanges> tracker; | ||
| private: | ||
| // Private wrapper functions for rmissing manipulation | ||
| // These ensure rmissing can only be modified through controlled interfaces |
There was a problem hiding this comment.
nit: Comment is misleading - rmissing is public, it just so happens that only methods in this class insert and erase entries from rmissing.
Most of the time, a single version in a PG can only correspond to a single object. However, following a PG merge it is possible, even likely, that two objects will have the same version. The PG Log works around this by discarding the log. However, during backfill, it is possible for the missing list to be build with these duplicate versions. A recently added assert detected that this scenario was corrupting the reverse missing list (rmissing). This behaviour has always existed, but was previously unnoticed. It could cause some bugs and potentially loop-asserts on OSDs, although mostly would not be noticed. Here we fix this properly, by converting rmissing to a multimap. This is wrapped in some insert functions, which assert that the rmissing list does not end up with duplicate entries. The code is optimised for the case where there are no duplicate versions. Additionally, some of the old asserts have been rolled into the insert functions. Fixes: https://tracker.ceph.com/issues/75778 Signed-off-by: Alex Ainscow <[email protected]>
db41803 to
f394040
Compare
jdurgin
left a comment
There was a problem hiding this comment.
Nice addition of unit tests covering a range of edge cases and new behavior!
Most of the time, a single version in a PG can only correspond to a single object.
However, following a PG merge it is possible, even likely, that two objects will
have the same version. The PG Log works around this by discarding the log.
However, during backfill, it is possible for the missing list to be build with
these duplicate versions.
A recently added assert detected that this scenario was corrupting the reverse
missing list (rmissing). This behaviour has always existed, but was previously
unnoticed. It could cause some bugs and potentially loop-asserts on OSDs,
although mostly would not be noticed.
Here we fix this properly, by converting rmissing to a multimap. This is wrapped
in some insert functions, which assert that the rmissing list does not end up
with duplicate entries. The code is optimised for the case where there are no
duplicate versions.
Additionally, some of the old asserts have been rolled into the insert functions.
Fixes: https://tracker.ceph.com/issues/75778
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 DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.