docs: translate README and documentation to English
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>
This commit is contained in:
1 parent
907d400765
commit
b7d2a0687e
6 files changed
+655
-628
No files matched your search
+263
-248
@@ -1,58 +1,57 @@
|
||||
# Migrationsprototyp
|
||||
# Migration prototype
|
||||
|
||||
Die Prüfung eines direkten RADOS-Objekttransfers und die native Alternative
|
||||
über libcephfs sind in [raw-transfer.md](raw-transfer.md) dokumentiert.
|
||||
The evaluation of a direct RADOS object transfer and the native alternative
|
||||
through libcephfs are documented in [raw-transfer.md](raw-transfer.md).
|
||||
|
||||
## Snapshot-Identität: dokumentierte Abweichung
|
||||
## Snapshot identity: documented deviation
|
||||
|
||||
Native Snapshot-IDs und Ceph-Geburtszeitpunkte werden am Ziel neu vergeben.
|
||||
Wie vereinbart blockiert diese Abweichung die Migration nicht. `inspect`,
|
||||
die Übertragungsausgabe und das persistente Journal enthalten einen Hinweis;
|
||||
ursprüngliche und neue Erstellungszeiten stehen bei jedem übertragenen Snapshot.
|
||||
Eine Anwendung, die native IDs direkt speichert, muss die neuen Werte beachten.
|
||||
Native snapshot IDs and Ceph birth times are assigned anew at the target. As
|
||||
agreed, this deviation does not block the migration. `inspect`, the transfer
|
||||
output and the persistent journal contain a note; the original and the new
|
||||
creation times are recorded for every transferred snapshot. An application
|
||||
that stores native IDs directly must account for the new values.
|
||||
|
||||
Die unterstützte `ceph_mksnap`-Schnittstelle nimmt Namen, Modus und
|
||||
benutzerdefinierte Metadaten entgegen, aber keine gewünschte native ID oder
|
||||
Geburtszeit. `ceph.snap.btime` ist im Client ausdrücklich schreibgeschützt.
|
||||
Auch CephFS-Mirroring erzeugt im Ziel einen neuen Snapshot und hält die
|
||||
Quell-ID als separate Metadaten fest.
|
||||
The supported `ceph_mksnap` interface accepts a name, a mode and custom
|
||||
metadata, but no desired native ID or birth time. `ceph.snap.btime` is
|
||||
explicitly read-only in the client. CephFS mirroring also creates a new
|
||||
snapshot at the target and records the source ID as separate metadata.
|
||||
|
||||
Quellen:
|
||||
Sources:
|
||||
|
||||
- [libcephfs-Schnittstelle](https://github.com/ceph/ceph/blob/main/src/include/cephfs/libcephfs.h)
|
||||
- [Client: virtuelle Snapshot-Attribute](https://github.com/ceph/ceph/blob/main/src/client/Client.cc)
|
||||
- [Mirror: Anlegen eines Zielsnapshots](https://github.com/ceph/ceph/blob/main/src/tools/cephfs_mirror/PeerReplayer.cc)
|
||||
- [libcephfs interface](https://github.com/ceph/ceph/blob/main/src/include/cephfs/libcephfs.h)
|
||||
- [Client: virtual snapshot attributes](https://github.com/ceph/ceph/blob/main/src/client/Client.cc)
|
||||
- [Mirror: creating a target snapshot](https://github.com/ceph/ceph/blob/main/src/tools/cephfs_mirror/PeerReplayer.cc)
|
||||
|
||||
Im lokalen Ceph-21.2.0-Labor wurden bei einem gleichnamigen Snapshot
|
||||
Quell-ID 6 und Ziel-ID 2 sowie unterschiedliche Geburtszeiten gemessen.
|
||||
Ein Schreibversuch mit dem bereits vorhandenen Wert von `ceph.snap.btime`
|
||||
am eigenen Testsnapshot wurde mit `EROFS` abgewiesen.
|
||||
In the local Ceph 21.2.0 lab, a snapshot of the same name had source ID 6 and
|
||||
target ID 2 and different birth times. An attempt to write the existing value
|
||||
of `ceph.snap.btime` on our own test snapshot was rejected with `EROFS`.
|
||||
|
||||
Mit den geprüften Schnittstellen lässt sich die native Snapshot-Identität nicht
|
||||
vorgeben. Diese Einschränkung ist akzeptiert; sie wird ausdrücklich vermerkt.
|
||||
Lastnachweise und eine automatisierte produktive Client-Umschaltung fehlen noch.
|
||||
The examined interfaces do not allow the native snapshot identity to be set.
|
||||
This limitation is accepted and explicitly recorded. Load tests and an
|
||||
automated production client cutover are still missing.
|
||||
|
||||
## Kommandos
|
||||
## Commands
|
||||
|
||||
Das native Backend benötigt Linux, Ceph CLI, libcephfs und einen mit CGO und
|
||||
`-tags ceph` gebauten Kopierer. Es benötigt keine Betriebssystem-Mounts und
|
||||
keinen privilegierten Container. Zum Erhalten fremder UID/GID und geschützter
|
||||
xattrs sind entsprechende Client-/Prozessrechte nötig; das Labor verwendet root.
|
||||
Der optionale Referenzpfad `backend: rsync` benötigt zusätzlich rsync und am
|
||||
Dateisystem-Root gemountete Quell-/Zieldateisysteme.
|
||||
Die Subvolumes müssen schon existieren. Für einen neuen Job müssen Datenbaum,
|
||||
Snapshots und benutzerdefinierte Metadaten des Ziels leer sein.
|
||||
Keine Anwendung darf ins Ziel schreiben.
|
||||
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.
|
||||
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.
|
||||
|
||||
Die Konfiguration in `dev/migration.example.json` wählt `backend: native` und
|
||||
gilt im Labordienst `native`. `mount` wird dort nicht verwendet und kann fehlen.
|
||||
`workers` begrenzt gleichzeitige Dateikopien (Standard 8, maximal 64),
|
||||
`bandwidth_kib` begrenzt die Summe geschriebener Nutzdatenbytes pro Sekunde.
|
||||
Beide Werte dürfen bei Wiederaufnahme geändert werden.
|
||||
Die nativen `transfer`-Statistiken im Journal nennen Modus, Basis-Snapshot,
|
||||
besuchte/kopierte Dateien sowie geschriebene und zur Prüfung gelesene Bytes.
|
||||
`bytes_copied` zählt Nutzdaten-Schreibzugriffe ohne ausgesparte Nullbereiche;
|
||||
es misst nicht das gesamte Netzwerkaufkommen einschließlich Protokoll und Prüfung.
|
||||
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),
|
||||
`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
|
||||
ranges; it does not measure the total network traffic including protocol and
|
||||
verification.
|
||||
|
||||
```sh
|
||||
make dev-native-build
|
||||
@@ -61,194 +60,212 @@ docker compose -f dev/compose.yaml exec native \
|
||||
cephmig-native inspect --config /lab/migration.example.json
|
||||
```
|
||||
|
||||
Der lesende Preflight vergleicht CLI-FSID und die über den Client gelesene
|
||||
`ceph.cluster_fsid`, prüft Pfade und Subvolume-Status und meldet die aktuelle
|
||||
Datenmenge sowie Snapshotnamen. Die Datenmenge ist **keine** Kapazitätsprognose
|
||||
für alle historischen Snapshots.
|
||||
The read-only preflight compares the FSID from the CLI with the
|
||||
`ceph.cluster_fsid` read through the client, checks paths and subvolume state
|
||||
and reports the current data size and snapshot names. The data size is **not**
|
||||
a capacity forecast for all historical snapshots.
|
||||
|
||||
Das Backend hat folgende Übertragungskommandos:
|
||||
The backend has the following transfer commands:
|
||||
|
||||
```sh
|
||||
cephmig sync --config /absolute/config.json --state /local-state/job.json
|
||||
cephmig status --state /local-state/job.json
|
||||
# Alle Quellwriter einschließlich weiterer Clients stoppen und flushen.
|
||||
# Stop and flush all source writers, including other clients.
|
||||
cephmig finalize --config /absolute/config.json \
|
||||
--state /local-state/job.json --writers-stopped
|
||||
# After the cutover has been checked:
|
||||
cephmig cleanup --config /absolute/config.json --state /local-state/job.json
|
||||
```
|
||||
|
||||
`sync` verarbeitet bekannte, noch nicht abgeschlossene Stände, neu entdeckte
|
||||
Anwendungssnapshots und danach einen neuen Quellsnapshot. Weitere Änderungen
|
||||
werden durch erneutes `sync` nachgezogen. Das native Backend verwendet Snapdiff
|
||||
und die Ceph-Inode-Version; dadurch werden auch Datenänderungen gleicher Größe
|
||||
und gleicher mtime erkannt. Der rsync-Pfad verwendet Prüfsummen.
|
||||
`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.
|
||||
|
||||
`finalize` bestätigt den Schreibstopp ausschließlich über die ausdrückliche
|
||||
Operatorangabe; es stoppt oder sperrt selbst keine Anwendung. Alle Writer
|
||||
müssen bis zur abgeschlossenen Umschaltung gestoppt bleiben. Der Job endet
|
||||
bei `ready-for-cutover`. Remounts, Neustarts der Anwendungen und eine
|
||||
Rückmigration nach Schreibzugriffen am Ziel sind nicht automatisiert.
|
||||
`finalize` relies solely on the operator's explicit confirmation of the write
|
||||
stop; it does not stop or lock any application itself. All writers must stay
|
||||
stopped until the cutover is complete. The job ends in `ready-for-cutover`.
|
||||
Remounts, application restarts and a migration back after writes to the
|
||||
target are not automated.
|
||||
|
||||
## Übertragene Daten
|
||||
### Migration snapshots
|
||||
|
||||
- Snapshotnamen und Inhalte; bestehende Snapshots werden chronologisch übertragen.
|
||||
- Numerische UID/GID, Modus, POSIX-ACLs einschließlich Default-ACLs.
|
||||
- Zeitstempel je Datei, Verzeichnis und Symlink:
|
||||
Each round creates a snapshot `cephmig-<job>-<round>` at source and target.
|
||||
Only the newest one is needed, as base for the next round. As soon as a round
|
||||
is complete, `sync` deletes the older round snapshots on both sides. Users of
|
||||
the subvolume therefore see at most one migration snapshot at a time.
|
||||
|
||||
| Zeitstempel | native | rsync |
|
||||
`cleanup` deletes the remaining round snapshot, including the final one,
|
||||
after the job is `ready-for-cutover`. Afterwards the subvolumes hold only the
|
||||
snapshots of the application. Since the final snapshot is the immutable
|
||||
reference of the last round, run `cleanup` only after the cutover has been
|
||||
checked. `cleanup` is idempotent.
|
||||
|
||||
Application snapshots are never deleted. The journal marks a snapshot as
|
||||
`removed` before deleting it, so an interrupted run completes the deletion
|
||||
next time.
|
||||
|
||||
## Transferred data
|
||||
|
||||
- Snapshot names and contents; existing snapshots are transferred in
|
||||
chronological order.
|
||||
- Numeric UID/GID, mode, POSIX ACLs including default ACLs.
|
||||
- Timestamps of every file, directory and symlink:
|
||||
|
||||
| Timestamp | native | rsync |
|
||||
| --- | --- | --- |
|
||||
| mtime (letzte Änderung) | ja | ja |
|
||||
| btime (Erstellung) | ja | nein |
|
||||
| atime (letzter Zugriff) | ja | nein |
|
||||
| ctime (letzte Statusänderung) | ja¹ | nein |
|
||||
| mtime (last modification) | yes | yes |
|
||||
| btime (creation) | yes | no |
|
||||
| atime (last access) | yes | no |
|
||||
| ctime (last status change) | yes¹ | no |
|
||||
|
||||
¹ Nanosekundengenau, aber nie kleiner als die mtime: Ist an der Quelle die
|
||||
mtime neuer als die ctime (mtime in die Zukunft gesetzt), erhält das Ziel
|
||||
¹ 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
|
||||
ctime = mtime.
|
||||
|
||||
Keine Dateisystemschnittstelle setzt die ctime direkt; Ceph 21.2.0 ignoriert
|
||||
`CEPH_SETATTR_CTIME`. Der MDS übernimmt als ctime aber den Zeitstempel, den
|
||||
der Client mit jeder Anfrage schickt, und libcephfs liest ihn aus
|
||||
`clock_gettime(CLOCK_REALTIME)`. Das native Backend ersetzt `clock_gettime`
|
||||
im eigenen Prozess (Symbol-Interposition, nur im aufrufenden Thread und nur
|
||||
für die Dauer eines libcephfs-Aufrufs; die Go-Laufzeit liest die Uhr über
|
||||
den vDSO und ist nicht betroffen):
|
||||
No file system interface sets the ctime directly; Ceph 21.2.0 ignores
|
||||
`CEPH_SETATTR_CTIME`. The MDS does, however, take the ctime from the time
|
||||
stamp the client sends with each request, and libcephfs reads that stamp
|
||||
from `clock_gettime(CLOCK_REALTIME)`. The native backend replaces
|
||||
`clock_gettime` in its own process (symbol interposition, only in the
|
||||
calling thread and only for the duration of one libcephfs call; the Go
|
||||
runtime reads the clock through the vDSO and is not affected):
|
||||
|
||||
- Jeder ändernde Aufruf läuft mit dem Zeitstempel 1970-01-01T00:00:01Z.
|
||||
- Als letzte Änderung eines Eintrags legt das Backend das xattr
|
||||
`user.cephmig.ctime` an und entfernt es wieder, mit der Quell-ctime als
|
||||
Zeitstempel. Der MDS setzt dabei ctime = max(Zeitstempel, mtime), auch
|
||||
rückwärts. Setattr und Cap-Flushes bewegen die ctime dagegen nur vorwärts.
|
||||
- Verzeichnisse werden nach allen Änderungen ihrer Kinder gestempelt,
|
||||
Hardlinks nach dem Verlinken und nach dem Entfernen überzähliger Namen.
|
||||
- Der Client, der schreibt, cacht für Verzeichnisse teils eine abweichende
|
||||
ctime. Die Prüfung vor der Veröffentlichung liest das Ziel deshalb über
|
||||
einen eigenen, frisch verbundenen Client.
|
||||
- Every modifying call runs with the time stamp 1970-01-01T00:00:01Z.
|
||||
- As the last change to an entry, the backend creates and removes the xattr
|
||||
`user.cephmig.ctime`, stamped with the source ctime. The MDS then sets
|
||||
ctime = max(stamp, mtime), also backwards. Setattr and cap flushes, in
|
||||
contrast, only move the ctime forward.
|
||||
- Directories are stamped after all changes to their children, hardlinks
|
||||
after linking and after removing surplus names.
|
||||
- The writing client sometimes caches a different ctime for directories.
|
||||
The verification before publication therefore reads the target through a
|
||||
separate, freshly connected client.
|
||||
|
||||
Das Verhalten ist im Labor gemessen, nicht von Ceph zugesichert; die
|
||||
Prüfung meldet jede Abweichung. Die atime im Ziel ändert sich danach durch
|
||||
normale Lesezugriffe der Anwendung. rsync kann unter Linux keine btime
|
||||
übertragen; atime wird nicht übernommen, weil die Prüfsummenprüfung über
|
||||
den Mount die atime im Ziel verändern kann.
|
||||
- Benutzer-xattrs und weitere portable xattrs; einschließlich leerer Werte und Löschungen.
|
||||
- Hardlinks innerhalb des Subvolumes, Symlinks und FIFOs.
|
||||
- Sparse-Dateiinhalte; der native Pfad überspringt Nullbereiche bzw. verwendet Hole-Punching.
|
||||
Die physische Platzbelegung wird nicht zugesichert.
|
||||
- Verzeichnisquotas `ceph.quota.max_bytes` und `ceph.quota.max_files`, auch am Datenroot.
|
||||
- Benutzerdefinierte Subvolume- und Snapshot-Metadaten über die Manager-API.
|
||||
- Ursprüngliche und neue Snapshot-Erstellungszeiten im Journal.
|
||||
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.
|
||||
- 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.
|
||||
The physical space usage is not guaranteed.
|
||||
- Directory quotas `ceph.quota.max_bytes` and `ceph.quota.max_files`, also at
|
||||
the data root.
|
||||
- Custom subvolume and snapshot metadata through the manager API.
|
||||
- Original and new snapshot creation times in the journal.
|
||||
|
||||
Softlinks bleiben als Linktext erhalten, auch wenn das Ziel nicht existiert.
|
||||
Der native Pfad erhält auch Hardlinks auf Symlinks und FIFOs; bei Symlinks
|
||||
verknüpft er die Inode über die öffentliche Low-Level-Schnittstelle, damit der
|
||||
Link selbst und nicht sein Referent verknüpft wird.
|
||||
Absolute Links werden nicht umgeschrieben; bei der Umschaltung muss der
|
||||
Anwendungs-Mountpfad dazu passen. Hardlinks über die Grenze des übertragenen
|
||||
Subvolumes hinaus werden nicht als gemeinsame Verknüpfung migriert.
|
||||
Symlinks are kept as link text, even if their target does not exist. The
|
||||
native path also preserves hardlinks to symlinks and FIFOs; for symlinks it
|
||||
links the inode through the public low-level interface, so that the link
|
||||
itself and not its referent is linked.
|
||||
Absolute links are not rewritten; at cutover, the application's mount path
|
||||
must match them. Hardlinks across the boundary of the transferred subvolume
|
||||
are not migrated as a shared link.
|
||||
|
||||
Clusterinterne Layout-, Pool- und andere `ceph.*`-Attribute werden nicht
|
||||
blind kopiert; Quotas werden gesondert übertragen. Pool-/Layout-Mappings,
|
||||
Subvolumegruppenquotas, Pinning, Authorisierungen, Snapshot-Zeitpläne, aktive
|
||||
Clone-Jobs und weitere Ceph-Verwaltungszustände sind nicht implementiert.
|
||||
Die Migration übernimmt die von der Subvolume-API aufgelisteten Snapshots mit
|
||||
ihrem gesamten Verzeichnisbaum. CephFS unterstützt allgemein Verzeichnissnapshots;
|
||||
eigene Snapshots unterhalb eines verwalteten Subvolumes verweigert der MDS jedoch.
|
||||
Im Ceph-21.2.0-Labor war ein Snapshot eines normalen Verzeichnisses erfolgreich,
|
||||
derselbe Versuch in einem Subvolume-Unterordner scheiterte mit `EPERM`.
|
||||
In Unterordnern sichtbare, geerbte Snapshot-Ansichten sind Bestandteil des
|
||||
übergeordneten Subvolume-Snapshots. Die frühere Warnung zu separaten
|
||||
Unterverzeichnissnapshots war für dieses verwaltete Subvolume-Modell zu pauschal.
|
||||
Siehe [MDS-Prüfung der Subvolume-Grenze](https://github.com/ceph/ceph/blob/main/src/mds/Server.cc).
|
||||
Beim rsync-Backend bleiben ctime und atime nicht erhalten; bei beiden Backends
|
||||
werden originale Inode-Nummern und native Snapshot-IDs neu vergeben.
|
||||
Verschlüsselte, normalisierte, nicht case-sensitive oder mit Earmark versehene
|
||||
Subvolumes werden abgelehnt.
|
||||
Cluster-internal layout, pool and other `ceph.*` attributes are not copied
|
||||
blindly; quotas are transferred separately. Pool and layout mappings,
|
||||
subvolume group quotas, pinning, authorizations, snapshot schedules, active
|
||||
clone jobs and other Ceph management state are not implemented.
|
||||
The migration transfers the snapshots listed by the subvolume API with their
|
||||
entire directory tree. CephFS supports directory snapshots in general, but
|
||||
the MDS refuses separate snapshots below a managed subvolume. In the Ceph
|
||||
21.2.0 lab, a snapshot of a plain directory succeeded, while the same attempt
|
||||
in a subvolume subdirectory failed with `EPERM`. Inherited snapshot views
|
||||
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.
|
||||
Encrypted, normalized, case-insensitive or earmarked subvolumes are rejected.
|
||||
|
||||
## Wiederaufnahme und Verifikation
|
||||
## Resumption and verification
|
||||
|
||||
Der Job speichert ein atomar ersetztes, mit fsync gesichertes JSON-Journal
|
||||
mit Modus 0600. Es enthält Konfiguration, Cluster-FSIDs, die konkreten
|
||||
Subvolume-Datenpfade und Snapshot-Intent-/Abschlussinformationen. Eine
|
||||
Neuanlage desselben Subvolumenamens mit anderer Daten-UUID wird abgewiesen.
|
||||
The job keeps a JSON journal with mode 0600 that is replaced atomically and
|
||||
secured with fsync. It contains the configuration, the cluster FSIDs, the
|
||||
concrete subvolume data paths and per-snapshot intent and completion records.
|
||||
Recreating the same subvolume name with a different data UUID is rejected.
|
||||
|
||||
Eine lokale flock-Sperre verhindert parallele Zugriffe auf dasselbe Journal.
|
||||
Ein persistenter Claim unter `<target-filesystem>/.cephmig/claims/` mit
|
||||
exklusiver Datei-/CephFS-Sperre schützt das Ziel auch bei verschiedenen lokalen
|
||||
Journalpfaden. Ein fehlendes oder unvollständiges Journal wird nicht durch
|
||||
automatische Übernahme vorhandener Zieldaten ersetzt.
|
||||
A local flock lock prevents concurrent access to the same journal. A
|
||||
persistent claim under `<target-filesystem>/.cephmig/claims/` with an
|
||||
exclusive file/CephFS lock protects the target even across different local
|
||||
journal paths. A missing or incomplete journal is never replaced by
|
||||
automatically adopting existing target data.
|
||||
|
||||
Jeder Snapshotstand wird kopiert, einschließlich Quotas verifiziert und erst
|
||||
danach am Ziel als Snapshot angelegt. Ein bereits angelegter, aber noch nicht
|
||||
im Journal bestätigter Zielsnapshot wird bei Wiederaufnahme erneut gegen die
|
||||
unveränderliche Quelle geprüft. Ersatz oder Verlust bereits abgeschlossener
|
||||
Snapshots wird anhand der gespeicherten Identität erkannt.
|
||||
Each snapshot state is copied, verified including quotas, and only then
|
||||
created as a snapshot at the target. A target snapshot that was created but
|
||||
not yet confirmed in the journal is verified again against the immutable
|
||||
source on resumption. Replacement or loss of already completed snapshots is
|
||||
detected from the stored identity; snapshots the journal marks as `removed`
|
||||
are exempt.
|
||||
|
||||
Der native Datenpfad verwendet einen lokalen bbolt-Index mit Quell-Inode,
|
||||
Inode-Version, Größe und Ziel-Inode pro Pfad. Er enthält keine Dateiinhalte.
|
||||
Die bestätigte Basis wird vor jeder Zieländerung im JSON-Journal ungültig
|
||||
gemacht und erst nach erfolgreicher Verifikation und einem fsync des Index
|
||||
erneut bestätigt. Cluster, Daten-UUID-Pfade und Snapshotname müssen passen.
|
||||
Nach einem Abbruch wird der offene Stand vollständig nativ rekonstruiert;
|
||||
ein nur teilweise ausgeführter Blockdiff darf nicht als Basis gelten.
|
||||
Ein bereits publizierter, unbestätigter Zielsnapshot wird erneut geprüft.
|
||||
Nach SIGKILL kann die Freigabe alter Ceph-Clientsitzungen den Wiederanlauf verzögern.
|
||||
The native data path uses a local bbolt index with source inode, inode
|
||||
version, size and target inode per path. It contains no file contents. The
|
||||
confirmed base is invalidated in the JSON journal before any change to the
|
||||
target and confirmed again only after successful verification and an fsync of
|
||||
the index. Clusters, data UUID paths and snapshot name must match. After an
|
||||
interruption, the open state is reconstructed fully and natively; a partially
|
||||
applied blockdiff must not count as a base. An already published but
|
||||
unconfirmed target snapshot is verified again. After SIGKILL, the release of
|
||||
old Ceph client sessions can delay the restart.
|
||||
|
||||
Der Index enthält außerdem das vollständige Pfadinventar des unveränderlichen
|
||||
Quellsnapshots: Dateien, Verzeichnisse, Hardlink-Aliase und Spezialdateien.
|
||||
Erst nach vollständiger Erfassung wird es als vollständig markiert. Aufräumen
|
||||
und Überhangprüfung gleichen Zielpfade mit diesem lokalen Inventar ab und
|
||||
vermeiden dadurch erneute `stat`-Abfragen für jeden Quellpfad. Unvollständige
|
||||
oder beschädigte Inventare führen zum Abbruch. Bereits identische Inode-Zeilen
|
||||
werden bei der Verifikation nicht erneut in den Index geschrieben.
|
||||
The index also contains the complete path inventory of the immutable source
|
||||
snapshot: files, directories, hardlink aliases and special files. It is
|
||||
marked complete only after it has been fully recorded. Pruning and the check
|
||||
for surplus target paths compare target paths with this local inventory and
|
||||
thus avoid another `stat` call for every source path. Incomplete or damaged
|
||||
inventories abort the run. Identical inode rows are not written to the index
|
||||
again during verification.
|
||||
|
||||
Unveränderliche Pfade unter `.snap` werden bei `stat` und `readdirplus` mit
|
||||
`AT_STATX_DONT_SYNC` gelesen, wie in Cephs eigenem Mirror. Dadurch werden
|
||||
Metadatensperren nicht allein für eine erneute Synchronisation bereits
|
||||
unveränderlicher Snapshot-Inodes angefordert. Live-Zielpfade behalten ihre
|
||||
normale Synchronisationssemantik. Details und Messergebnisse stehen in
|
||||
[smallfiles-local.md](smallfiles-local.md).
|
||||
Immutable paths under `.snap` are read with `AT_STATX_DONT_SYNC` for `stat`
|
||||
and `readdirplus`, as in Ceph's own mirror. This avoids requesting metadata
|
||||
locks just to resynchronize snapshot inodes that cannot change anyway. Live
|
||||
target paths keep their normal synchronization semantics. Details and
|
||||
measurements are in [smallfiles-local.md](smallfiles-local.md).
|
||||
|
||||
Bei einer vollständigen Kopie vergleicht die native Prüfung alle Dateiinhalte.
|
||||
Bei Folgeständen prüft sie kopierte Dateien bzw. die von Blockdiff gemeldeten
|
||||
Bereiche. Unveränderte Bytes stammen aus der zuvor verifizierten Basis. Daher
|
||||
muss der Zielbaum während des gesamten Jobs ausschließlich dem Kopierer gehören.
|
||||
Fremde Änderungen unveränderter Dateibereiche werden damit nicht zuverlässig
|
||||
gefunden. Metadaten, Quotas und Hardlink-Topologie werden in jedem Stand geprüft.
|
||||
Ein direkt nach der Prüfung angelegter Zielsnapshot wird auf Metadaten und
|
||||
Links geprüft; dieselben unveränderlichen Daten werden nicht erneut gelesen.
|
||||
For a full copy, the native verification compares all file contents. For
|
||||
later states, it checks copied files or the ranges reported by blockdiff.
|
||||
Unchanged bytes come from the previously verified base. The target tree must
|
||||
therefore belong exclusively to the copier for the entire job. Foreign
|
||||
changes to unchanged file ranges are not reliably detected this way.
|
||||
Metadata, quotas and hardlink topology are checked in every state. A target
|
||||
snapshot created right after the verification is checked for metadata and
|
||||
links; the same immutable data is not read again.
|
||||
|
||||
Die rsync-Prüfung liest Dateiinhalte per Checksumme und vergleicht zusätzlich
|
||||
die unterstützten Metadaten. Quotawerte werden separat geprüft. Wiederaufnahme
|
||||
innerhalb eines Standes nutzt die vorhandenen Teilkopien, muss den Baum aber
|
||||
erneut scannen; Checkpoints sind derzeit pro Snapshot, nicht pro Datei.
|
||||
Bei einem im Labor reproduzierten Hardlink-`EEXIST` wird genau einmal
|
||||
idempotent wiederholt; andere Fehler werden sofort zurückgegeben.
|
||||
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.
|
||||
|
||||
Zusätzlich wird die Hardlink-Topologie in beide Richtungen geprüft: alle
|
||||
Quellpfade derselben Inode müssen im Ziel zusammengehören; unabhängige
|
||||
Quelldateien dürfen im Ziel nicht versehentlich dieselbe Inode teilen.
|
||||
Das ist nötig, weil [rsync -H](https://download.samba.org/pub/rsync/rsync.1)
|
||||
überzählige bestehende Zielverknüpfungen nicht in jedem Fall auflöst.
|
||||
Im rsync-Pfad werden vor dem Kopieren solche überzähligen Verknüpfungen am
|
||||
exklusiven Ziel entfernt und aus dem Quellsnapshot neu aufgebaut. Der native
|
||||
Pfad erzeugt vollständige Kopien atomar als neue Inodes und setzt anschließend
|
||||
die Hardlink-Aliase. Alte Zielsnapshots
|
||||
bleiben unverändert. Symlink-Verzeichnisse werden dabei nicht verfolgt.
|
||||
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.
|
||||
|
||||
Die Prüfzuordnungen liegen in einem temporären bbolt-Index neben dem Journal;
|
||||
Schreibtransaktionen werden nach 4.096 Beobachtungen abgeschlossen. Der Index
|
||||
wird nach jedem Prüf-/Reparaturlauf verworfen und bei Bedarf neu aufgebaut.
|
||||
Er ist kein Wiederaufnahmejournal. Der native Basisindex unter
|
||||
`<journal>.native/base.bolt` bleibt dagegen erhalten. Dafür muss lokal ausreichend Platz
|
||||
vorhanden sein. Pfadtiefen über 128 Verzeichnisse werden derzeit abgewiesen.
|
||||
Nach einem harten Prozessabbruch während eines Indexlaufs können temporäre
|
||||
Indexverzeichnisse übrig bleiben; sie werden nicht als Checkpoints verwendet.
|
||||
The verification mappings live in a temporary bbolt index next to the
|
||||
journal; write transactions are committed after 4,096 observations. The index
|
||||
is discarded after every verification or repair run and rebuilt when needed.
|
||||
It is not a resumption journal. The native base index under
|
||||
`<journal>.native/base.bolt`, in contrast, is kept. Sufficient local disk
|
||||
space is required for it. Path depths beyond 128 directories are currently
|
||||
rejected. After a hard process abort during an index run, temporary index
|
||||
directories can remain; they are never used as checkpoints.
|
||||
|
||||
Quell- und Zielsnapshots werden nicht automatisch gelöscht. Journal und Claim
|
||||
müssen für Wiederaufnahme erhalten bleiben. Ein unvollständiger Claim nach
|
||||
einem Absturz während seiner allerersten Anlage wird absichtlich nicht
|
||||
automatisch repariert; dafür ist eine Prüfung der ursprünglichen Job-ID nötig.
|
||||
Journal and claim must be kept for resumption. An incomplete claim after a
|
||||
crash during its very first creation is deliberately not repaired
|
||||
automatically; that requires checking the original job ID.
|
||||
|
||||
## Tests und Größenordnung
|
||||
## Tests and scale
|
||||
|
||||
```sh
|
||||
make check
|
||||
@@ -257,64 +274,62 @@ make dev-migration-test
|
||||
make dev-native-test
|
||||
```
|
||||
|
||||
Die Integrationstests erzeugen eigene Subvolumes und prüfen historische Stände,
|
||||
Änderungsnachlauf, Metadaten, entfernte Dateien, Kopierfehler und einen
|
||||
SIGKILL nach dem Anlegen eines Zielsnapshots, aber vor dem Journal-Commit.
|
||||
Er prüft auch den gespeicherten Hinweis auf neue Snapshot-Identitäten und das
|
||||
Auflösen zuvor vorhandener Hardlinks bei unveränderten Dateiinhalten.
|
||||
Bei Erfolg entfernt er ausschließlich seine eigenen Fixtures; bei Fehlern
|
||||
bleiben die ausgegebenen Testpfade zur Diagnose erhalten.
|
||||
The integration tests create their own subvolumes and check historical
|
||||
states, catching up with changes, metadata, removed files, copy errors and a
|
||||
SIGKILL after a target snapshot was created but before the journal commit.
|
||||
They also check the stored note about new snapshot identities, the
|
||||
resolution of previously existing hardlinks with unchanged file contents, the
|
||||
removal of older round snapshots during `sync` and the removal of all
|
||||
migration snapshots by `cleanup`. On success they remove only their own
|
||||
fixtures; on failure the reported test paths are kept for diagnosis.
|
||||
|
||||
Der native Test verwendet einen Kopierer ohne FUSE-Gerät, CephFS-Mounts und
|
||||
rsync. Ein separater FUSE-Anwendungsclient prüft unabhängig alle Dateiinhalte
|
||||
mit SHA-256 sowie Metadaten, Links und Snapshots. Er prüft eine 4-KiB-Änderung
|
||||
in einer 64-MiB-Datei bei gleicher mtime, Wachstum und Nullbereiche, Linkgruppen
|
||||
mit Trennung/Wiedervereinigung sowie Wechsel zwischen Verzeichnis und Symlink.
|
||||
Hardlinks auf nicht auflösbare Symlinks und FIFOs werden ebenfalls unabhängig
|
||||
anhand der Inodes verglichen, einschließlich späterer Trennung einer FIFO-Gruppe.
|
||||
Weitere Prüfungen betreffen Abbruch während der Kopie, SIGKILL unmittelbar nach
|
||||
Snapshot-Erzeugung, Wiederanlauf und idempotenten Abschluss. Währenddessen
|
||||
schreibt eine Anwendung fortlaufend in ein anderes Quell-Subvolume.
|
||||
The native test uses a copier without a FUSE device, CephFS mounts or rsync.
|
||||
A separate FUSE application client independently checks all file contents
|
||||
with SHA-256, as well as metadata, links and snapshots. It checks a 4 KiB
|
||||
change in a 64 MiB file with the same mtime, growth and zero ranges, link
|
||||
groups that are split and rejoined, and changes between directory and
|
||||
symlink. Hardlinks to unresolvable symlinks and FIFOs are also compared
|
||||
independently by inode, including a later split of a FIFO group. Further
|
||||
checks cover cancellation during the copy, SIGKILL right after snapshot
|
||||
creation, restart and idempotent completion. Meanwhile, an application keeps
|
||||
writing to another source subvolume.
|
||||
|
||||
Laborergebnis vom 05.11.2026 mit Ceph 21.2.0: nativer Integrationstest und
|
||||
rsync-Regression erfolgreich; Go-Tests einschließlich Race Detector und
|
||||
`go vet` für den Ceph-Build erfolgreich. Der native Test schloss fünf Stände
|
||||
mit `ready-for-cutover` ab und prüfte sie zusätzlich über den Anwendungsclient.
|
||||
Bei der Änderung von 4 KiB in der 64-MiB-Datei wurden für diese Datei 4 KiB,
|
||||
für den gesamten zweiten Stand einschließlich weiterer geänderter Dateien
|
||||
4.128 Nutzdatenbytes geschrieben. Im unveränderten finalen Stand waren es
|
||||
0 Nutzdatenbytes. Das ist ein Funktionsnachweis, kein Durchsatzbenchmark.
|
||||
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
|
||||
`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
|
||||
changed files. In the unchanged final state, 0 payload bytes were written.
|
||||
This is a functional proof, not a throughput benchmark.
|
||||
|
||||
Der lesende Identitätsvergleich für bereits vorhandene Laborsnapshots lautet:
|
||||
The read-only identity comparison for existing lab snapshots is:
|
||||
|
||||
```sh
|
||||
python3 /lab/snapshot-identity.py \
|
||||
--config /absolute/lab-config.json --snapshot existing-snapshot
|
||||
```
|
||||
|
||||
Go liest Verzeichnisquotas in Batches und hält keine Liste aller Dateien.
|
||||
Das gilt **nicht** als Speicherobergrenze des externen rsync-Prozesses:
|
||||
große Einzelverzeichnisse und Hardlinkgruppen können dort erheblichen
|
||||
Speicher benötigen. Jeder Stand verursacht vollständige Scans und
|
||||
Checksum-Lesevorgänge. Geänderte große Dateien können bei neuen Snapshots
|
||||
erheblichen zusätzlichen Zielplatz benötigen.
|
||||
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.
|
||||
|
||||
Im nativen Pfad sind Datei-Worker, Datenpuffer und Verzeichnisiteration begrenzt;
|
||||
Kopier- und Vergleichspuffer sind höchstens 4 MiB groß und werden für kleine
|
||||
Dateien bzw. kurze Prüfbereiche entsprechend verkleinert. Identische Besitzer,
|
||||
Rechte und mtime lösen keinen erneuten `setattr`-Aufruf aus; eine unmittelbar
|
||||
zuvor gelesene Zielstatistik wird bei der Metadatenprüfung wiederverwendet.
|
||||
Pfad-/Hardlink-Zuordnungen liegen auf lokalem Datenträger. Snapdiff und Blockdiff
|
||||
vermeiden wiederholte Vollübertragung und vollständiges Lesen unveränderter
|
||||
Dateiinhalte. Die Implementierung scannt aber weiterhin alle Metadaten,
|
||||
einschließlich vollständiger Topologie- und Quotaprüfung. Umbenannte Dateien
|
||||
können erneut vollständig kopiert werden. Einzeltransaktionen des nativen
|
||||
Index sind noch nicht auf 200 Millionen Pfade optimiert.
|
||||
|
||||
200 TB und mehr als 200 Millionen Dateien sind damit noch nicht nachgewiesen.
|
||||
Für diese Freigabe fehlen insbesondere Scans vermeidende Änderungsplanung,
|
||||
belastbare Speicher-/Laufzeitmessungen, ein Kapazitätsmodell für historische
|
||||
Versionen sowie ein automatisierter Client-Cutover. Eine feste maximale
|
||||
Schreibstopplänge wird nicht zugesichert. Native API-Aufrufe sind blockierend;
|
||||
Abbruch wird zwischen Aufrufen geprüft und wartet auf bereits laufende I/O.
|
||||
In the native path, 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
|
||||
for the metadata check. Path and hardlink mappings live on local disk.
|
||||
Snapdiff and blockdiff avoid repeated full transfers and full reads of
|
||||
unchanged file contents. The implementation still scans all metadata,
|
||||
including the full topology and quota check. Renamed files may be copied
|
||||
again in full. Single transactions of the native index are not yet optimized
|
||||
for 200 million paths.
|
||||
|
||||
200 TB and more than 200 million files are therefore not yet proven. What is
|
||||
missing for that release in particular: change planning that avoids scans,
|
||||
reliable memory and runtime measurements, a capacity model for historical
|
||||
versions and an automated client cutover. A fixed maximum write-stop duration
|
||||
is not guaranteed. Native API calls block; cancellation is checked between
|
||||
calls and waits for I/O already in progress.
|
||||
Reference in new issue
Block a user