Repository navigation
mds: clear batch_op_map when the batch op is released - #71274
Conversation
batrick
left a comment
There was a problem hiding this comment.
Please create a tracker issue so that this issue can be tracked for backporting.
Then, please annotate the commit which fixes/resolves a Ceph tracker issue with:
Fixes: http://tracker.ceph.com/issues/...
This is essential when examining the history of the repository (this commit fixes what) and helps merge scripts identify issues that have been resolved by a merge. See this article on GitHub on how to amend commits and update your pull request.
|
LGTM, and waiting the tracker. |
The a non-nullptr value in `MDRequestImpl::batch_op_map` signals "I own batch_ops[mask]" (via is_batch_head()), but it was only ever cleared in Batch_Getattr_Lookup::find_new_head(), when ownership is handed over to a follower. Neither place that erases the entry cleared it: release_batch_op() and the killed-batch-head block in MDCache::request_cleanup(). A request whose entry had already been erased therefore kept claiming to be the batch head, and the next visitor did find(mask) on a map that no longer has that key. Nothing checks the iterator, so it was dereference and erase(end()) was called, which could easily lead to a crash with assertion failure: /usr/include/c++/11/bits/stl_tree.h:1206: [...] Assertion '__position != end()' failed. Client eviction is an easy way to hit this: journal_close_session() kills every request of the session. find_new_head() drops killed followers, which makes the "no new head, erase the entry" case the common one during an eviction. Fixes: https://tracker.ceph.com/issues/79951 Signed-off-by: Max Kellermann <[email protected]>
2555caa to
c77995d
Compare
|
@batrick, ticket added |
|
jenkins test api |
|
This PR has been added to main integration testing by vshankar started 2026-09-02-13:52. |
The a non-nullptr value in
MDRequestImpl::batch_op_mapsignals "I own batch_ops[mask]" (via is_batch_head()), but it was only ever cleared in Batch_Getattr_Lookup::find_new_head(), when ownership is handed over to a follower. Neither place that erases the entry cleared it: release_batch_op() and the killed-batch-head block in MDCache::request_cleanup().A request whose entry had already been erased therefore kept claiming to be the batch head, and the next visitor did find(mask) on a map that no longer has that key. Nothing checks the iterator, so it was dereference and erase(end()) was called, which could easily lead to a crash with assertion failure:
/usr/include/c++/11/bits/stl_tree.h:1206: [...] Assertion '__position != end()' failed.
Client eviction is an easy way to hit this: journal_close_session() kills every request of the session. find_new_head() drops killed followers, which makes the "no new head, erase the entry" case the common one during an eviction.
Fixes: https://tracker.ceph.com/issues/79951
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.