Repository navigation
mds/snapdiff: snapdiff doesn't report modified files - #69895
Conversation
c64869e to
88fe270
Compare
|
PR #68054 adds functionality to specify mask for file attribute changes. I haven't reviewed it yet, but it seems like the changes introduced in that PR to specify mask params is probably a bit more flexible. |
88fe270 to
812b377
Compare
There was a problem hiding this comment.
Pull request overview
Updates MDS snapdiff handling to wait for client snap flushes and re-enables CephFS mirroring integration tests.
Changes:
- Synchronizes inode metadata before snapdiff comparisons.
- Defers replies while snap flushes are pending.
- Re-enables two mirroring tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/mds/Server.h |
Extends the snapdiff helper API with waiting state. |
src/mds/Server.cc |
Adds snap-flush synchronization and metadata comparisons. |
qa/tasks/cephfs/test_mirroring.py |
Re-enables affected mirroring tests. |
Comments suppressed due to low confidence (1)
src/mds/Server.cc:12660
- Equal
mtimeis still treated as proof that the file is unchanged. A client can overwrite same-sized data and restore the original timestamp; writes incrementchange_attr(src/client/Client.cc:12291-12295) and snap flush imports it (src/mds/Locker.cc:3979-3984), but this comparison ignores it and drops the file from snapdiff. Compare a write-sensitive snapshot attribute after synchronization rather than relying only onmtime.
if (mtime == before.mtime) {
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
812b377 to
8c27936
Compare
8c27936 to
02b8bc6
Compare
|
The snapdiff duration with the fix. Observe increment_duration2 Comparing the same with the sample tentacle run without multithreaded mirroring - https://pulpito-ng.ceph.com/runs/khiremat-2026-08-11_15:29:17-fs-wip-khiremat-mirror-backports-tentacle-10082026-distro-default-trial |
This is effectively 2x the latency :/ |
|
@kotreshhr - change seems reasonable. I will run this through tests to assess once more. |
|
jenkins test windows |
2 similar comments
|
jenkins test windows |
|
jenkins test windows |
02b8bc6 to
7c55e6f
Compare
|
Rebased to fix jenkins windows test |
|
jenkins test windows |
|
make check and windows ci job failed because of Not related to snapdiff libcephfs test as earlier |
Sounds good. Will run through tests. |
67582d9 to
9689b60
Compare
|
Rebased because of merge conflict |
9689b60 to
a3556a4
Compare
|
jenkins test windows |
|
jenkins test make check |
|
jenkins test api |
23351dd to
2e20ff5
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Problem: readdir_snapdiff walks directory dentries and compares file mtimes between two snapshots to decide which entries changed. When a client still has dirty snap caps, metadata writeback (snapflush) may be in progress on the HEAD inode. In that window both the snap-side and HEAD-side inodes can expose the same stale mtime, so build_snap_diff incorrectly treats the file as unchanged and omits it from the diff. Testcase: This showed up in cephfs-mirror incremental sync: after modifying files (e.g. git pull) and taking a new snapshot, snapdiff(snap_b, snap_c) returned no entries for files that had actually changed, leaving the secondary missing updates such as .git/logs/HEAD. The tests that were failing were test_cephfs_mirror_incremental_sync and test_cephfs_mirror_sync_with_purged_snapshot Fix: Wait for snapflush before trusting an equal-mtime comparison, matching the snapped-read path in handle_client_open which rdlocks the child filelock so writers flush before metadata is read. Changes: - Add an optional `waiting` out-parameter to build_snap_diff. When snapflush blocks, set it and return without finishing the RPC; _readdir_diff drops the partial reply and the existing C_MDS_RetryRequest path retries once the lock is available. - Introduce rdlock_file_mtime() using rdlock_start/rdlock_finish on the child filelock. - Only rdlock when comparing a before/after dentry pair with the same ino and equal unlocked mtimes -- the case where snapflush may still be hiding a real change. If unlocked mtimes already differ, include the file immediately with no lock. Store the before mtime without locking; rdlock only the later (typically HEAD) inode in the pair. Fixes: https://tracker.ceph.com/issues/74984 Signed-off-by: Kotresh HR <[email protected]>
2e20ff5 to
ed0b33f
Compare
|
@vshankar I think the merge conflict resolution needs to be done carefully. I will take one more look. please don't merge |
ed0b33f to
4427b75
Compare
When a dentry spans both snapid_prev and snapid, build_snap_diff skips it without comparing metadata. If snapflush is still outstanding, that skip can hide a real change. Add snapflush_pending() using client_snap_caps on snap inodes and client_need_snapflush on HEAD for snaps in [snapid_prev, snapid]. When snapflush is pending, rdlock the filelock first so metadata comparisons run on flushed state, then apply the multiversion hardlink and mtime checks from PR ceph#70953. For the dentry pair compare path, only rdlock when snapflush is pending instead of always rdlocking on equal unlocked metadata. Fixes: https://tracker.ceph.com/issues/74984 Signed-off-by: Kotresh HR <[email protected]>
4427b75 to
1ebbf45
Compare
Include the following skipped tests back since the bug is fixed. test_cephfs_mirror_incremental_sync test_cephfs_mirror_sync_with_purged_snapshot Also remove the assert check which validates full sync time to be greater than incremental sync time. With separate crawler thread introduced with multi-threaded mirroring, for a few thousand files, full sync is faster than using snapdiff Also, add evicting unrepsonsive client warning to ignore list for both valgrind and normal runs as it's expected in fs:mirror as a result of commit 518edfe Fixes: https://tracker.ceph.com/issues/74984 Signed-off-by: Kotresh HR <[email protected]>
|
Sample mirror qa run with the rebased changes - @vshankar The run looks good but required a warning 'evicting unresponsive clients' to be added to ignore list of valgrind mirror suite as well. I was only added to run without valgrind. I will refresh the PR adding that. |
1ebbf45 to
5489bf4
Compare
Done - 5489bf4#diff-893142109427b64c905a19b784351bef3cee9c627408245ef716bd7d0acc62dfR35 |
|
This change is good to merge as the mirror dameon tests have passed. See: https://pulpito.ceph.com/vshankar-2026-09-18_14:09:51-fs-wip-vshankar-testing-20260916.092455-distro-default-trial/ However, there is still a corner case in snapdiff that could cause it to miss reporting file. See: https://tracker.ceph.com/issues/80634 I have a fix for the above tracker and it's based on top of this change. |
The snapdiff doesn't report files which are modified in following case
The following upstream teuthology tests caught this.
a. test_cephfs_mirror_incremental_sync
b. test_cephfs_mirror_sync_with_purged_snapshot
The PR takes care of fixing them.
Fixes: https://tracker.ceph.com/issues/74984
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.