cephfs-mirror: cephfs-mirror should be able to do operations concurrently for large directory(updated)#63950
cephfs-mirror: cephfs-mirror should be able to do operations concurrently for large directory(updated)#63950sajibreadd wants to merge 1 commit intoceph:mainfrom
Conversation
86722da to
293ca4e
Compare
293ca4e to
10a3b63
Compare
joscollin
left a comment
There was a problem hiding this comment.
@vshankar
Test failure: https://pulpito.ceph.com/jcollin-2025-06-17_02:42:47-fs:mirror-wip-jcollin-testing-con-160625-distro-default-smithi/
We had all green for blockdiff. So this failure is introduced by this PR.
| - cephfs-mirror | ||
| min: 1 | ||
| with_legacy: true | ||
| - name: cephfs_mirror_sync_latest_snapshot |
There was a problem hiding this comment.
@vshankar @sajibreadd
cephfs_mirror_sync_latest_snapshot is already implemented by #61929 3 months ago. So this should be dropped from this PR.
|
@joscollin According to the traceback it's failing here On this line, which means, the Before this line there was Which also internally calls the status command, but didn't fail. Can it be possible adding that peer crashes the daemon itself? |
@joscollin As cephfs_mirror_sync_latest_snapshot by default true, so when directory has no snapshots, this comparison will have seg fault but anyway you told me to remove this part of code. So removing it will fix the error. |
10a3b63 to
340f138
Compare
|
@joscollin the error should be fixed now. |
340f138 to
970e64f
Compare
1. Concurrent file syncing using user defined thread count.
2. Concurrent directory scanning using user defined thread count.
3. When remote is inconsistent(failed sync attempt previously happend)
we traeversed the unchanged part between previous snapshot and
current snapshot using snapdiff strategy(as it is intact in remote
as well). For changed part we use remote state as diff base, which
saved us from syncing already transfrerred entries.
Some minor improvements:
1. Saved stat reading and updating using a change mask. Which contains
all the stat changes and state of the entry by using a bitmask. Such
that we can only update the changed stats.
2. For an entry when we know that it's a new entry(or previous snapshot has
different type), we simply moved on creating the entries under it's subtree
without taking care of what remote or previous snapshot has. More specifically,
it should not do unnecessary stat in the base state(previous snapshot or remote).
As in the major improvemnt point 2, I already handled the failed attempt case
So this strategy will work in all case.
3. In propagate_deleted_entries, we did some stat call to find out deleted
entries, but we did stat for entries which exist in both current and previous
(or remote state) snapshot. I used a map to save the change mask in a map
such that we don't need to stat it again. For obvious memory limitation, we won't
be able to keep all the entries. That's why I limit the map till 1e5 entries.
So for a certain moment, each thread can contain a map which can have 1e5 entries
in the worst case.
4. Added some extra stats
Fixes: https://tracker.ceph.com/issues/69190
Signed-off-by: Md Mahamudur Rahaman Sajib <mahamudur.sajib@croit.io>
970e64f to
07e0495
Compare
Okay, the old one get passed, but this one is with |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
Hi, just checking on the status of this PR. Any update on its progress? |
Hey @thomascazampoure - it is a largish feature and the team hasn't yet gotten to reviewing it in depth. We are planning to get this included in the next (Umbrella) release. |
|
@sajibreadd I created a feature tracker to use asynchronous IO interface in libcephfs in the mirror daemon. See: https://tracker.ceph.com/issues/73577 The interfaces are not stable yet, but the plan is stabilise of the Umbrella release. Please let me know your thoughts on this. cc @thomascazampoure |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
Fixes: https://tracker.ceph.com/issues/69190
Signed-off-by: Md Mahamudur Rahaman Sajib mahamudur.sajib@croit.io
Concurrent Full Mirroring Design
Overview
The goal of this design is to improve the efficiency of directory mirroring at scale.
In the previous approach, concurrency was present but provided little benefit when:
To solve this, the mirroring process is restructured around two dedicated task thread pools.
Thread Pools
1. FileSyncPool
2. DirScanPool
Responsible for directory scanning and creation, directory I/O, file metadata I/O.
Directory creation has dependencies:
In this tree, directory (2) must exist before (4) and (5) can be created.
Queue Size Constraint
1e5tasks).Avoiding Deadlocks
A naïve wait–notify model can deadlock. Example:
Solution:
Benefits
Summary
This design achieves true concurrent mirroring by separating file transfers and directory operations into dedicated pools, applying dependency-aware task definitions, limiting queue size, and adopting an inline execution fallback when the queue is full.
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 Definition