Repository navigation
mds: prevent CDir omap commit with empty updates/removals/header - #68793
Conversation
salieri11
left a comment
There was a problem hiding this comment.
The fix looks reasonable
it prevents a crash by checking for empty operations before committing. This is better than crashing.
Summary
The bug happens when:
- Both
stalesandto_removelists are empty - An inode is very large (bigger than
max_dir_commit_size) - The code calls
commit_one()with empty_setand_rmsets - This triggers the assertion at line 2448 and crashes the MDS
The fix adds a check to skip the commit when there is nothing to commit.
Suggestions
-
Add debug logging: Consider adding a
dout()warning when we hit this edge case. This will help find why the inode size is so large when it happens again.dout(5) << "skipping empty commit, inode size exceeded max_dir_commit_size" << dendl;
|
This PR has been added to wip-vshankar-testing-20260513.092143. |
Thanks for the suggestion. Agreed - I will push in the additional change. |
Empty `stales` and `to_remove` causes `size` to be initialized with sizeof(fnode_t). If the encoded inode size (plus fnode_t size) exceeds max_dir_commit_size, commit_one() is called as a non-header update with empty `_set` and `_rm` sets causing the MDS to assert. While this patch prevents the assert, it is unknown at this point as to why the encoded inode size is so large. We have seen it before once, but there is lack of debug information to dig into. This fix will prevent the assert, however, the MDS would go read-only due to the large rados operation size, but at least we will have a live system to debug at that point. Fixes: http://tracker.ceph.com/issues/76455 Signed-off-by: Venky Shankar <[email protected]>
Done. Please check @salieri11 |
|
Changes with latest push:
|
|
jenkins test make check arm64 |
Empty
stalesandto_removecausessizeto be initialized with sizeof(fnode_t). If the encoded inode size (plus fnode_t size) exceeds max_dir_commit_size, commit_one() is called as a non-header update with empty_setand_rmsets causing the MDS to assert.While this patch prevents the assert, it is unknown at this point as to why the encoded inode size is so large. We have seen it before once, but there is lack of debug information to dig into. This fix will prevent the assert, however, the MDS would go read-only due to the large rados operation size, but at least we will have a live system to debug at that point.
Fixes: http://tracker.ceph.com/issues/76455
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.