Repository navigation
Conversation
|
With the fix #69895 the test did reproduce the issue once in 50 runs. So the test is catching the issue but it's very racy. |
Yeh. For me, it failed in within 10 iterations, so the race window depends on a lot of things converging :/ |
| // @snapid is not known here yet. | ||
| for (const auto& p : head->get_client_caps()) { | ||
| const Capability& cap = p.second; | ||
| if ((cap.issued() & CEPH_CAP_ANY_WR) && cap.client_follows < snapid) { |
There was a problem hiding this comment.
Should this be as below ?
int issued = cap.need_snapflush() ? CEPH_CAP_ANY_WR : cap.issued();
if ((issued & CEPH_CAP_ANY_WR) && cap.client_follows < snapid)
return true;
The cow_inode() also uses the similar check
Line 1636 in 3316a9e
I think the case is that if the client wrote and dropped the Fwb then cap.need_snapflush would catch that ?
There was a problem hiding this comment.
I think the case is that if the client wrote and dropped the Fwb then cap.need_snapflush would catch that ?
Fwb will be dropped only after it can flush its buffered data, so the cap update/snapflush race still holkds true. I think the additional cap.need_snapflush() is really not required due to the client_follows check here.
There was a problem hiding this comment.
As far as the check in cow_inode is concerned, the check here (in snapdiff) should cover a broader case since we do not do any additional check that cow_inode() does.
There was a problem hiding this comment.
Yeah I was little confused on why it's done in cow_inode! You are right, Fwb is dropped only after FLUSHSNAP is received.
There was a problem hiding this comment.
Well, unfortunately this condition is buggy for loner client doing sync write (exactly, what LibCephFS.SnapDiffLib2 does. There are no queues cap snaps from such clients and the predicate just keeps on revoking Fw rdlock_start and hands it over back in rdlock_finish.
6e011a6 to
fbbb09d
Compare
Fixed. |
|
lgtm |
|
This PR has been added to main integration testing by vshankar started 2026-09-21-09:47. |
|
@vshankar The windows test seems to be real failure with the PR ? Assisted-by: cursor, I didn't spend too much time on this. |
|
OK, so this is a live-lock, not really a deadlock and its reproducible. We would have caught it in teuthology testing but I'm happy that it got caught earlier. Here is the bug:
Then, the next file:
... over and over again. The combination of the loner client, the lock state and the readdir retry results in cap revoke+grant over and over. |
fbbb09d to
c8b8ea9
Compare
|
@kotreshhr - unfortunately 0c0577a does not fully fix the issue. So, I am going to work on it separately (separate PR). For this PR, I will just be including the projected inode fixes. |
https://tracker.ceph.com/issues/80778 (tracker for this change which will include just the projected inode fixes) |
Signed-off-by: Venky Shankar <[email protected]>
A file modified between two snapshots could be missing from readdir_snapdiff output, leaving cephfs-mirror silently out of sync until the file changed again. Locker::_do_snap_update() applies a FLUSHSNAP by projecting onto the inode and journalling an EUpdate; the projection is popped only when that entry commits, and unlike the regular cap flush path it never calls mdlog->flush(). Server::build_snap_diff() meanwhile read committed state via CInode::get_inode(), so between the FLUSHSNAP arriving and the journal committing it saw the pre-snapflush values. The COW itself runs synchronously, so the diff ends up comparing a correctly COWed snapshot inode against a head that still carries the old metadata, concludes nothing changed, and drops the entry: handle_client_caps on 0x1000000001b tid 4 follows 1e op flushsnap _do_snap_update dirty Fw follows 1e snap 1f on [inode ... [1e,head] s=2] cow_inode [inode ... [1f,head] auth v4 pv10 ... s=2 n(..b2..)->n(..b4096..)] to [inode ... [1e,1e] ... s=2] v4/pv10 is the hint here: size 4096 exists only in the projection while get_inode() still reports 2, which is what the comparison used. The window closes on the next mdlog flush though. For this fix, read both operands through get_projected_inode() instead, in EntryInfo::meta_differs() and in the head branch of inode_at_snap(). old_inodes needs no equivalent change: _do_snap_update() installs it with reset_old_inodes() before submitting the journal entry rather than projecting it. Fixes: http://tracker.ceph.com/issues/80778 Signed-off-by: Venky Shankar <[email protected]>
Fortunately, this fd leak exposed in a bug in LibCephFS.SnapDiffLib2() test with the fixes for the newly introduced LibCephFS.SnapDiffPendingCapsnap() test. The bug will be fixed separately and a legit test involving an open file descriptor will be added as a separate commit. Signed-off-by: Venky Shankar <[email protected]>
readdir_snapdiff against a directory whose files are open for write is an ordinary state -- a database, a log writer or an rsync in flight all hold a descriptor open -- but nothing in this file exercised it deliberately. write_full() leaked its descriptors, so every test here happened to run that way by accident. With that fixed, the coverage is gone. An open descriptor keeps Fw in caps_wanted(), so the MDS re-grants EXCL as soon as any rdlock taken on the file is released. This scenario needs to be kept as part of the test matrix. So, hold two descriptors open across a snap1 vs snap2 diff and assert the expected entries. Signed-off-by: Venky Shankar <[email protected]>
c8b8ea9 to
2100b67
Compare
|
jenkins test windows |
1 similar comment
|
jenkins test windows |
|
jenkins test make check |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Fixes: https://tracker.ceph.com/issues/80778
cc @LiShengG
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.