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

+16 -21
View File
@@ -16,18 +16,15 @@ snapshot, verifies the target and creates a snapshot of the same name there.
A journal on local disk records every step. For the last round, all writers
are stopped briefly.
There are two backends:
- **native** (recommended): the copier talks to both clusters directly
through libcephfs. It needs neither rsync nor a kernel or FUSE mount.
After the initial transfer it uses snapdiff and, where possible, blockdiff.
- **rsync**: copies between two mounted CephFS file systems.
The copier talks to both clusters directly through libcephfs. It needs no
kernel or FUSE mount. After the initial transfer it uses snapdiff and, where
possible, blockdiff.
**Status:** prototype. The features are verified in the local lab. Load
tests at the target size and a production cutover are still missing.
> **Documented deviations:** native snapshot IDs and snapshot creation times
> are assigned anew at the target. The native backend takes mtime, atime,
> are assigned anew at the target. CephMig takes mtime, atime,
> ctime and birth time (btime) of every file from the source; the ctime is
> never lower than the mtime. The original snapshot creation times are kept
> in the journal.
@@ -38,7 +35,7 @@ tests at the target size and a production cutover are still missing.
Requirements:
- Linux, Go 1.25 or later and GNU Make
- for the native backend and the lab: Docker Engine with Docker Compose and
- for the copier and the lab: Docker Engine with Docker Compose and
`/dev/fuse` on the Docker host
- for the lab: up to 12 GiB RAM for the containers and about 8 GiB of disk
space for the two OSDs, plus space for the images
@@ -49,12 +46,13 @@ Get the source and build it:
git clone ssh://git@git.zb-server.de:30022/Sebi/CephfsMig.git
cd CephfsMig
make doctor # checks Go, Docker and Docker Compose
make build # builds bin/cephmig (rsync backend only)
make build # builds bin/cephmig without libcephfs (doctor and status only)
make check # go vet, Go tests and a syntax check of the test scripts
```
The native backend needs CGO and the libcephfs headers, so it is built in a
container. The build also runs the Go tests with the race detector:
The copier needs CGO and the libcephfs headers (build tag `ceph`), so it is
built in a container. The build also runs the Go tests with the race
detector:
```sh
make dev-native-build # builds the image cephmig-native:dev
@@ -79,8 +77,8 @@ cephmig status --state FILE
| `cleanup` | deletes the snapshots cephmig created and its claim on the target |
| `status` | prints the journal |
All results are written to standard output as JSON. The state file must be
outside the CephFS mounts.
All results are written to standard output as JSON. The state file belongs
on local disk.
Steps of a migration:
@@ -145,16 +143,14 @@ The configuration is a JSON file, here
"keyring": "/clusters/source/ceph.client.admin.keyring",
"filesystem": "cephfs",
"group": "migration",
"subvolume": "demo",
"mount": "/mnt/source-fs"
"subvolume": "demo"
},
"target": {
"config": "/clusters/target/ceph.conf",
"keyring": "/clusters/target/ceph.client.admin.keyring",
"filesystem": "cephfs",
"group": "migration",
"subvolume": "demo",
"mount": "/mnt/target-fs"
"subvolume": "demo"
},
"bandwidth_kib": 0
}
@@ -162,8 +158,8 @@ The configuration is a JSON file, here
Optional fields are `user` (Ceph client identity, e.g. `client.migration`),
`workers` (0 to 64; 0 selects the default) and `full_scan` (`true` makes
every round read all metadata instead of skipping unchanged subtrees). `mount` is only needed for
the rsync backend: the mount of the file system root.
every round read all metadata instead of skipping unchanged subtrees).
`backend` may be omitted; its only value is `native`.
## Examples
@@ -184,7 +180,6 @@ More tests:
| Target | Content |
|----------------------------|-----------------------------------------------------------|
| `make dev-migration-test` | migration with the rsync backend |
| `make dev-smallfiles-test` | 10,000 small files (`FILES=2000` limits the number) |
| `make dev-million-start` | one million files with four snapshot states |
| `make dev-restart-check` | restart of the lab; FSIDs and data are preserved |
@@ -200,7 +195,7 @@ and [docs/million-local.md](docs/million-local.md).
│ ├── cephmig/ command-line program
│ └── nativeprobe/ diagnostic tool for the libcephfs binding
├── internal/
│ ├── migration/ migration workflow, journal, rsync and native transfer
│ ├── migration/ migration workflow, journal and native transfer
│ ├── storage/ file system interface of the native copier
│ └── cephfsnative/ CGO binding to libcephfs (build tag ceph)
├── dev/ lab: Compose files, Dockerfiles, test scripts