Repository navigation
cephfs-mirror: sync file size when blockdiff is empty - #70923
Merged
kotreshhr merged 1 commit intoSep 23, 2026
Merged
Conversation
LiShengG
marked this pull request as ready for review
August 8, 2026 00:54
LiShengG
marked this pull request as draft
August 8, 2026 00:58
LiShengG
force-pushed
the
agent/cephfs-mirror-empty-blockdiff
branch
from
August 8, 2026 00:59
5c236de to
1181105
Compare
LiShengG
marked this pull request as ready for review
August 8, 2026 01:00
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
A size-only snapshot change can make file blockdiff complete without returning any changed data extents. SnapDiffSync then skips its callback, so copy_to_remote() never reaches the ftruncate that updates the destination file size. Invoke the callback once with an empty block list when blockdiff succeeds without producing extents. Add regression coverage for object-boundary, partial-object and same-object shrink operations, plus sparse growth. Fixes: https://tracker.ceph.com/issues/79156 Signed-off-by: Li Sheng <[email protected]>
LiShengG
force-pushed
the
agent/cephfs-mirror-empty-blockdiff
branch
from
September 7, 2026 11:01
1181105 to
41ca4fd
Compare
kotreshhr
self-requested a review
September 9, 2026 14:06
kotreshhr
approved these changes
Sep 10, 2026
Contributor
|
jenkins retest this please |
Contributor
|
This PR has been added to main integration testing by khiremat started 2026-09-09-16:42. |
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix cephfs-mirror incremental synchronization when file blockdiff succeeds
without returning changed data extents.
For size-only changes, the mirror previously skipped the datasync callback
when
blocks.num_blockswas zero. As a result,copy_to_remote()was nevercalled, the destination file was not truncated to the current snapshot size,
and the mirror could still create the remote snapshot and advance its
checkpoint.
Invoke the callback once with an empty block list after a successful blockdiff
that produced no extents. This reaches the existing
ceph_ftruncate()pathwithout copying file data.
The regression test pins
cephfs_mirror_blockdiff_min_file_sizeto 16 MiB sothe cases cannot silently fall back to a full copy. It covers object-boundary,
partial-object and same-object shrink operations, along with sparse growth.
Fixes: https://tracker.ceph.com/issues/79156
Validation
git diff --checkpython3 -m py_compile qa/tasks/cephfs/test_mirroring.pycmake --build build --target cephfs-mirror -j 8TestMirroring.test_cephfs_mirror_blockdiff_pure_truncateTestMirroring.test_cephfs_mirror_incremental_sync_with_type_mixupChecklist