The writing client kept the caps of the files it wrote last. Every
lookup of the verification client on one of them made the MDS recall
the caps entry by entry, which cost about five seconds per lookup in
the lab and stalled a 100,000-file verification near its end.
Verify now opens a fresh target client, closes the writer, which
returns all caps at once, and keeps writing through the fresh client.
The claim lock is held through a client of its own, so it survives the
change.
Verify also checks non-directory entries in parallel with the
configured number of workers. The walk and the directories stay
serial, so skipped subtrees are handled in walk order.
Transfer statistics report the duration of each round in seconds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cleanup now deletes the claim file under .cephmig/claims as its last
step, if it holds the job's own ID, and removes the claim directories
when they are empty. A cleaned-up job is finished: cleanup and finalize
do nothing and do not claim the target again, and sync is refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also document the snapshot cleanup: older round snapshots are removed
during sync, and `cephmig cleanup` removes the rest after the cutover.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The MDS takes an inode's ctime from the time stamp the client sends with
each request. The native backend overrides clock_gettime per thread and
per libcephfs call: modifying calls run at 1970-01-01T00:00:01Z, and the
last change to each entry creates and removes the xattr
user.cephmig.ctime stamped with the source ctime. Link, unlink, rename
and xattr requests set ctime = max(stamp, mtime), also backwards.
- write xattrs and quotas before SetAttr, which must come last
- always restamp directories after their children and hardlinks after
linking or pruning, since the writer's cache may be stale
- verify through a separate, freshly mounted target client
- name the differing attributes in metadata mismatch errors
- compare ctime of every entry, the root included, in the lab fixture
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read atime and btime with statx and set them together with owner,
mode and mtime. Verification compares both, so a published snapshot
must match the source in all three times. The integration fixture
compares the times through libcephfs, since ceph-fuse does not expose
the birth time.
The ctime cannot be preserved: Ceph 21.2.0 accepts CEPH_SETATTR_CTIME
but stores the time of the call. The rsync backend still preserves
only the mtime.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Initial import of the existing CephFS subvolume migration prototype,
including the native libcephfs transport, rsync backend, local Ceph
lab environment and integration tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>