Repository navigation
mds: take waiting flock on unlock if owner itself is waiting - #71369
Conversation
ecd6a04 to
eabaa01
Compare
|
jenkins test make check |
xiubli
left a comment
There was a problem hiding this comment.
Good Catch.
Commit message: "actuall" -> "actually", "unlock woke WAIT_FLOCK" -> "unlock wakes WAIT_FLOCK".
Overall LGTM.
|
jenkins test make check arm64 |
handle_client_file_setlock() treated "owner has a request on the waiting list" and "owner holds a lock" as mutually exclusive: if is_waiting() matched, it cancelled the pending request and returned without ever calling remove_lock(). Yet an owner that is upgrading a shared lock to exclusive is both at the same time. Another unlock in that state (e.g. on another thread) therefore left the lock behind in `held_locks` without anybody actually holding a lock. All following attempts to take an exclusive lock on that file will block forever in "failed to add lock, waiting", retrying whenever some unrelated unlock wakes WAIT_FLOCK and getting nowhere. Recovery is only possible by restarting the MDS process; anything else, including client eviction, will not remove bogus `held_locks` entries. Solution: cancel the waiting entry if there is one, and, unless this is an interrupt (which cancels the pending request only), also remove the held lock. Fixes: https://tracker.ceph.com/issues/79952 Signed-off-by: Max Kellermann <[email protected]>
eabaa01 to
d5c0bff
Compare
|
Thanks @xiubli, I have pushed fixes for the commit message typos. |
|
jenkins test make check |
rishabh-d-dave
left a comment
There was a problem hiding this comment.
The tests looks fine, will do another pass for MDS code in some time.
| f1 = open(FILENAME, 'w') | ||
| f2 = open(FILENAME, 'w') |
There was a problem hiding this comment.
nit: s/f1/fd1 and s/f2/fd2 just for the sake of clearer naming?
There was a problem hiding this comment.
How is that any clearer? These are file objects, not file descriptors. It's open(), not os.open().
|
So basically if there are multiple owners say O1 and O2 having shared locks on the same range and O2 wants an exclusive then the |
|
This PR has been added to main integration testing by vshankar started 2026-09-02-13:52. |
handle_client_file_setlock() treated "owner has a request on the waiting list" and "owner holds a lock" as mutually exclusive: if is_waiting() matched, it cancelled the pending request and returned without ever calling remove_lock().
Yet an owner that is upgrading a shared lock to exclusive is both at the same time. Another unlock in that state (e.g. on another thread) therefore left the lock behind in
held_lockswithout anybody actuall holding a lock. All following attempts to take an exclusive lock on that file will block forever in "failed to add lock, waiting", retrying whenever some unrelated unlock woke WAIT_FLOCK and getting nowhere.Recovery is only possible by restarting the MDS process; anything else, including client eviction, will not remove bogus
held_locksentries.Solution: cancel the waiting entry if there is one, and, unless this is an interrupt (which cancels the pending request only), also remove the held lock.
Fixes: https://tracker.ceph.com/issues/79952
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.