feat!: remove the rsync backend

The native libcephfs backend is the only transfer path. The rsync
transport, the mounted-filesystem access and its helpers (mount check,
path resolution below a mount, mount claim, quota and hardlink repair
through the mount) are removed, together with the rsync lab test and
the client image that only added rsync.

The claim and release tests now exercise the native claim through a
local test file system with real flock locks.

BREAKING CHANGE: "backend": "rsync" and the endpoint field "mount" are
rejected. "backend" is optional and only accepts "native"; jobs created
with "native" resume without it. Journals of rsync jobs cannot be
resumed. Builds without the build tag ceph only support doctor and
status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-12-03 22:03:22 +01:00
1 parent f0ea1fd7cd
commit 330a3ec12c
31 files changed
+263 -1522

No files matched your search

+2 -3
View File
@@ -7,7 +7,7 @@ independent Ceph clusters. Introduction and overview: [README](../README.md).
The service `native` runs without privileged mode, without `/dev/fuse` and
without CephFS mounts. The separate privileged `client` serves as an
independent application client and for the rsync comparison test.
independent application client that checks the results through FUSE.
`make dev-smallfiles-test` checks 10,000 files of 128 bytes each by default,
plus hardlinks and symlinks. Half of the files are in one large directory,
@@ -43,8 +43,7 @@ snapshots live outside the current data UUID directory.
No host devices are formatted and no ports are published on the host. The
OSD data lives in Docker volumes. The replication factor 1 and the
administrator keys in the test client are for the local lab only. The client
extends the pinned Ceph base image with a pinned rsync package version. The
journal can be stored permanently under `/state` in a dedicated Docker
uses the pinned Ceph base image unchanged. The journal can be stored permanently under `/state` in a dedicated Docker
volume.
```sh
+35 -51
View File
@@ -32,24 +32,24 @@ automated production client cutover are still missing.
## Commands
The native backend needs Linux, the Ceph CLI, libcephfs and a copier built
with CGO and `-tags ceph`. It needs no operating system mounts and no
privileged container. Preserving foreign UID/GID and protected xattrs requires
the corresponding client and process privileges; the lab uses root. The
optional reference path `backend: rsync` additionally needs rsync and source
and target file systems mounted at the file system root.
CephMig needs Linux, the Ceph CLI, libcephfs and a copier built with CGO and
`-tags ceph`. It needs no operating system mounts and no privileged
container. Preserving foreign UID/GID and protected xattrs requires the
corresponding client and process privileges; the lab uses root. An rsync
backend over mounted file systems existed earlier and was removed; a
configuration with `backend: rsync` or `mount` is rejected.
The subvolumes must already exist. For a new job, the data tree, snapshots and
custom metadata of the target must be empty. No application may write to the
target.
The configuration in `dev/migration.example.json` selects `backend: native`
and applies to the lab service `native`. `mount` is not used there and may be
omitted. `workers` limits concurrent file copies (default 8, at most 64),
The configuration in `dev/migration.example.json` applies to the lab service
`native`. `backend` may be omitted; its only value is `native`. `workers`
limits concurrent file copies and verification checks (default 8, at most 64),
`bandwidth_kib` limits the total payload bytes written per second. Both values
may be changed when resuming.
The native `transfer` statistics in the journal report the mode, the base
snapshot, visited and copied files, and bytes written and read for
verification. `bytes_copied` counts payload writes without skipped zero
The `transfer` statistics in the journal report the mode, the base
snapshot, visited and copied files, bytes written and read for verification,
skipped subtrees and the duration of the round in seconds. `bytes_copied` counts payload writes without skipped zero
ranges; it does not measure the total network traffic including protocol and
verification.
@@ -65,7 +65,7 @@ The read-only preflight compares the FSID from the CLI with the
and reports the current data size and snapshot names. The data size is **not**
a capacity forecast for all historical snapshots.
The backend has the following transfer commands:
The transfer commands are:
```sh
cephmig sync --config /absolute/config.json --state /local-state/job.json
@@ -79,9 +79,8 @@ cephmig cleanup --config /absolute/config.json --state /local-state/job.json
`sync` processes known, unfinished states, newly discovered application
snapshots and then a new source snapshot. Further changes are caught up by
running `sync` again. The native backend uses snapdiff and the Ceph inode
version, so it also detects data changes with the same size and mtime. The
rsync path uses checksums.
running `sync` again. CephMig uses snapdiff and the Ceph inode version, so it
also detects data changes with the same size and mtime.
### Skipping unchanged subtrees
@@ -223,12 +222,12 @@ sequenceDiagram
- Numeric UID/GID, mode, POSIX ACLs including default ACLs.
- Timestamps of every file, directory and symlink:
| Timestamp | native | rsync |
| --- | --- | --- |
| mtime (last modification) | yes | yes |
| btime (creation) | yes | no |
| atime (last access) | yes | no |
| ctime (last status change) | yes¹ | no |
| Timestamp | preserved |
| --- | --- |
| mtime (last modification) | yes |
| btime (creation) | yes |
| atime (last access) | yes |
| ctime (last status change) | yes¹ |
¹ To the nanosecond, but never lower than the mtime: if the source mtime is
newer than its ctime (mtime set into the future), the target gets
@@ -259,9 +258,7 @@ sequenceDiagram
This behaviour was measured in the lab and is not guaranteed by Ceph; the
verification reports every deviation. The atime at the target subsequently
changes through normal reads of the application. rsync cannot transfer the
btime on Linux; the atime is not transferred because the checksum
verification through the mount can change the target atime.
changes through normal reads of the application.
- User xattrs and other portable xattrs, including empty values and removals.
- Hardlinks within the subvolume, symlinks and FIFOs.
- Sparse file contents; the native path skips zero ranges or punches holes.
@@ -292,8 +289,7 @@ visible in subdirectories are part of the parent subvolume snapshot. The
earlier warning about separate subdirectory snapshots was too broad for this
managed subvolume model.
See [MDS check of the subvolume boundary](https://github.com/ceph/ceph/blob/main/src/mds/Server.cc).
With the rsync backend, ctime and atime are not preserved; with both
backends, original inode numbers and native snapshot IDs are assigned anew.
Original inode numbers and native snapshot IDs are assigned anew.
Encrypted, normalized, case-insensitive or earmarked subvolumes are rejected.
## Resumption and verification
@@ -351,22 +347,13 @@ content comparison after the cutover is proposed in
snapshot created right after the verification is checked for metadata and
links; the same immutable data is not read again.
The rsync verification reads file contents by checksum and also compares the
supported metadata. Quota values are checked separately. Resuming within a
state reuses the existing partial copies, but has to scan the tree again;
checkpoints currently exist per snapshot, not per file. For a hardlink
`EEXIST` reproduced in the lab, the transfer is retried exactly once,
idempotently; other errors are returned immediately.
In addition, the hardlink topology is verified in both directions: all source
paths of the same inode must belong together at the target, and independent
source files must not accidentally share an inode at the target. This is
needed because [rsync -H](https://download.samba.org/pub/rsync/rsync.1) does
not resolve surplus existing target links in every case. Before copying, the
rsync path removes such surplus links in the exclusive target and rebuilds
them from the source snapshot. The native path creates full copies
atomically as new inodes and then sets the hardlink aliases. Old target
snapshots stay unchanged. Symlinked directories are not followed.
source files must not accidentally share an inode at the target. The copier
creates full copies atomically as new inodes and then sets the hardlink
aliases. Old target snapshots stay unchanged. Symlinked directories are not
followed. The verification walks the tree in order and checks directories
itself; all other entries are checked by up to `workers` goroutines.
The verification mappings live in a temporary bbolt index next to the
journal; write transactions are committed after 4,096 observations. The index
@@ -389,7 +376,6 @@ automatically; that requires checking the original job ID.
```sh
make check
go test -race ./...
make dev-migration-test
make dev-native-test
```
@@ -413,9 +399,10 @@ checks cover cancellation during the copy, SIGKILL right after snapshot
creation, restart and idempotent completion. Meanwhile, an application keeps
writing to another source subvolume.
Lab result of 2026-11-05 with Ceph 21.2.0: native integration test and rsync
regression passed; Go tests including the race detector and `go vet` for the
Ceph build passed. The native test completed five states with
Lab result of 2026-11-05 with Ceph 21.2.0: native integration test and the
regression test of the since removed rsync backend passed; Go tests
including the race detector and `go vet` for the Ceph build passed. The
native test completed five states with
`ready-for-cutover` and additionally checked them through the application
client. For the 4 KiB change in the 64 MiB file, 4 KiB were written for this
file and 4,128 payload bytes for the whole second state including other
@@ -429,13 +416,10 @@ python3 /lab/snapshot-identity.py \
--config /absolute/lab-config.json --snapshot existing-snapshot
```
Go reads directory quotas in batches and keeps no list of all files. This
does **not** bound the memory of the external rsync process: large single
directories and hardlink groups can need considerable memory there. Every
state causes full scans and checksum reads. Changed large files can need
considerable additional target space for new snapshots.
Changed large files can need considerable additional target space for new
snapshots.
In the native path, file workers, data buffers and directory iteration are
File workers, data buffers and directory iteration are
bounded; copy and compare buffers are at most 4 MiB and shrink for small
files and short verification ranges. Unchanged owner, mode and timestamps do
not trigger another `setattr` call; a target stat read just before is reused
+4 -3
View File
@@ -36,8 +36,8 @@ target.
## Verified native alternative
The Go transport `backend: native` uses libcephfs without rsync and without a
kernel or FUSE mount. Metadata operations go through the target MDS; data
The Go transport uses libcephfs without rsync and without a kernel or FUSE
mount. Metadata operations go through the target MDS; data
I/O is handled by the native Ceph client directly against RADOS. A raw import
of the shared MDS metadata pool remains outside the migration.
@@ -124,7 +124,8 @@ Snapdiff marks changed inodes; in addition, comparing the Ceph inode version
ensures that data changes with the same size and mtime are not missed.
Blockdiff is used from 16 MiB on, provided a confirmed base with matching
source and target inodes exists. If the diff interfaces are unavailable, the
state is reconstructed fully and natively. There is no silent rsync fallback.
state is reconstructed fully and natively. There is no fallback to another
transfer method.
Snapdiff cannot replace the metadata scan (see
[skipping unchanged subtrees](migration.md#skipping-unchanged-subtrees)).
-7
View File
@@ -117,13 +117,6 @@ the source snapshot after explicit confirmation; that is out of scope here.
- **Source:** the source cluster and its final snapshot must stay available
until `verify` is done.
## rsync backend
The same command can run with the rsync backend through the mounts, for
example `rsync -a --checksum --dry-run --itemize-changes` between the two
snapshot directories plus the existing quota and hardlink checks. Times other
than mtime are not compared there, because rsync does not preserve them.
## Tests
- Unit tests with fake file systems: every kind of difference is reported,