cetrafs
Start hereOrientation

Project status

Where cetrafs stands: ready for production on its target workload, what that rests on, the supported platforms, and what is out of scope.

cetrafs is ready for production use on its target workload: VM disk images on a shared LUN with atomic COMPARE AND WRITE. The on-disk format, the cluster protocol and the recovery paths are complete, and the list of known open defects is empty.

That claim rests on testing, not on years in the field. Every change goes through nearly 1,000 regression suites, a two-node suite on real SAN storage, crash replay, fuzzing and a KASAN build. The 0.10.5 release alone was checked by more than 7,700 assertions on two architectures, the whole gate again under KASAN, about 79,000 hostile images and a three-node cluster on a Fibre Channel array. How cetrafs is tested describes what is tested, how, and how long it takes.

As with any storage system, keep backups on other storage, and run a multi-node cluster with a cluster manager that can fence hosts.

Current release

The current release is 0.10.6. It writes on-disk format 0x000A, and mounts nothing else.

0x000A is the format change that release was built around: 48-bit file offsets, deeper extent trees, an inode table that grows with the volume, a checksum on every bitmap sector, a backup superblock, and the fields behind the cluster fixes. Volumes from 0.9.x (format 0x0009) aren’t mounted. Moving from 0.9.x to 0.10 means evacuating the data, reformatting and restoring: see Upgrade to a new format version.

Within one format version, nodes running different builds or different kernels can share a volume. A node whose module speaks another format version is refused at mount, so two formats never share a volume.

What changed in 0.10.6

0.10.6 keeps format 0x000A, so a 0.10.5 volume mounts as it is and nodes can be upgraded one at a time. It has one change, to fsync, and is recommended if programs on the host call fsync often. VM disks behave the same either way.

  • fsync is nearly four times faster after an overwrite: one round trip to the array instead of four, 0.52 ms instead of 2.0 ms on an FC array. It still makes the data, the file size and the file’s layout crash-safe. What it no longer does by default is make the file’s modification time crash-safe: a crash right after an fsync can bring back the previous mtime. Closing the file, or normal writeback, still saves it. See fsync and file times.
  • New mount option fsynctimes: fsync also makes the times crash-safe, as before, for software that depends on an mtime surviving a crash.

0.10.6 passed the full gate and the two-node release suite. The full validation campaign, with KASAN, the crash rig and the fuzzers, was run on 0.10.5: see The last validation run.

What changed in 0.10.5

0.10.5 is a maintenance release: fixes and hardening, no new features. It keeps format 0x000A, so a 0.10.4 volume mounts as it is and nodes can be upgraded one at a time. It is recommended for every cluster, especially one that grows volumes while they are mounted.

  • Hostile or damaged volumes are refused cleanly. The kernel, fsck.cetra and growfs.cetra check more on-disk values before using them, and refuse the same ones.
  • Fix: live grow on a slow host. Another node could take a running grow for dead.
  • Partial failures leave nothing behind. An operation that fails part way, on a full volume or a device error, no longer leaves the node believing something the disk doesn’t say.
  • Unmount. It no longer hangs on a multipath LUN, and no background work can start once it has begun. On a busy host the background cleanup gives leaked space back again; before, it could reclaim nothing.
  • fsck.cetra finds more and keeps going past the first fault in the cluster metadata. It now checks each file’s block count against its extents.
  • Writing to controls needs CAP_SYS_ADMIN.

Every module change since 0.10.4 came with a suite that reproduces the fault and fails without the fix: about 7,900 new lines of tests for 8,700 changed lines of code. The validation found one kernel bug, the live-grow one above, and it was fixed and the affected suites run again before the release. To us 0.10.5 is good to go. If you find a problem, please report it. See The last validation run.

What changed in 0.10.4

0.10.4 keeps format 0x000A, so a 0.10.3 volume mounts as it is and nodes can be upgraded one at a time.

  • Kernel 7.3. The module builds on 7.3, and DKMS builds it for kernels 7.0 to 7.3. Tested on Debian’s 7.3.4 and Proxmox VE’s 7.3.6-1-pve.
  • Fix: no build on Proxmox’s 7.3 kernels. The module used a kernel function those kernels don’t export to modules. It now uses one every kernel exports.
  • Fix: multipath LUNs mounted single-node on 7.3. On 7.3, cetrafs couldn’t read /sys to find the SCSI path under a multipath device, took the LUN for one without COMPARE AND WRITE, and mounted it single-node. It now finds the path, and if /sys can’t be read the mount is refused instead.

What changed in 0.10.3

0.10.3 keeps format 0x000A, so a 0.10.2 volume mounts as it is and nodes can be upgraded one at a time.

  • Fast I/O into holes in fragmented images. In a file with many extents, such as a VM image written in place, each 4 KiB of a hole used to cost a walk of most of the extent tree. Now a direct write into a hole maps the whole request at once, and a hole once found is remembered for reads. With about 49,000 extents, 1 MiB direct writes into a hole went from 241 to about 720 MB/s, and direct reads of a hole from 829 MB/s to 13 GB/s. See Holes in fragmented images.

What changed in 0.10.2

0.10.2 keeps format 0x000A: a 0.10.1 volume mounts as it is, and nodes can be upgraded one at a time.

  • Smooth large writes on thin LUNs. A node no longer hands back, every heartbeat, the empty space it has just claimed to write into. A Zone Group it is using keeps its empty Block Groups for a grace period (handback_grace, default 150 s) before they are unmapped and returned. A disk move into a sparse image no longer stalls every 15 seconds.
  • nofilelock disables defragmentation again. On Proxmox the background defragmenter kept moving VM images while qemu was filling them, and a disk move fell to a few MB/s.
  • A bounded wait for a full thin pool. A write waits up to space_wait_secs (default 300) for the array to find space, then the mount stops instead of hanging.
  • More fsck checks: duplicate and impossible directory names, gaps in a directory’s blocks, and file sizes past the format’s limit. fsck.cetra --live runs on a node that has the volume mounted.
  • The DKMS module reports its release in modinfo and /sys/module/cetrafs/version.
  • Fixes from a code review of the journal, allocator, scrub, trim and directory paths, and from 65 new test suites.

What changed in 0.10 (since 0.9.5)

  • Bigger files. A file can address 248 blocks (1 EiB, up from 16 TiB), and its extent tree goes one level deeper, to about 65 million extents. A directory grows the same way, to about 3.9 million entries.
  • A volume that grows in every dimension. A grow now adds inodes as well as space, so the inode count is no longer fixed at mkfs time.
  • Space returned to thin LUNs. An emptied Block Group is unmapped as it goes back to the pool, fstrim works, and -o discard returns space as it is freed. fallocate(ZERO_RANGE) zeroes in place with WRITE ZEROES. See Return free space to a thin LUN.
  • Stronger integrity. Every 512-byte sector of the allocation bitmaps has its own checksum; every address read off the disk is range-checked before it is used; a copy of the superblock sits at 8 MiB; and damage found at runtime leaves a lasting “needs fsck” mark.
  • No fsck after a crash. Mounting again repairs what an unclean shutdown left. fsck.cetra --live checks a volume while other nodes use it, and fsck.cetra -r rebuilds a damaged Zone Group, Block Group or Node Registry record.
  • Faster failover. An HA agent that has powered a host off can declare it dead at once, instead of waiting out the stale window.
  • Honest byte-range locks. fcntl locks are refused on a default mount instead of silently binding one node. See fcntl locks.
  • A thin pool that runs out of space pauses writes instead of stopping the mount at once, as VMFS does.
  • Defragmentation of sparse and preallocated images.
  • Nanosecond timestamps and a birth time, reported by statx.
  • Hundreds of fixes, most of them found by the new test tiers: two-node interleavings, crash cuts, ENOSPC sweeps and fuzzing.

Supported platforms

SupportedNotes
Kernels7.0.14, 7.1.8+deb13 (Debian), 7.2.11, 7.3.4 (Debian); Proxmox VE 7.0.14-*-pve and 7.3.6-1-pveDKMS builds the module for kernels 7.0 to 7.3 and skips any other.
Architecturesamd64, arm64The kernel must use 4 KiB pages. The on-disk format is little-endian and portable; only little-endian hosts are tested.
StorageAny block device for one node. For a cluster, a SCSI LUN with COMPARE AND WRITE, with 512-byte or 4 KiB logical blocks, single-path or dm-multipathNVMe and NVMe over Fabrics devices work on one node only: NVMe compare-and-write isn’t wired up.
Array cacheNon-volatile or write-throughcetrafs orders its writes with cache flushes. An array that acknowledges a flush before the data is safe breaks that ordering, and nothing on the host can detect it.

Validated on

  • Enterprise Fibre Channel: HPE 3PAR over 32 Gb FC multipath, two- and three-node Proxmox VE clusters, arm64 and amd64.
  • iSCSI: a commodity iSCSI LUN under a three-node amd64 Proxmox VE cluster.
  • Loop devices, for the single-node gate.

The last validation, on 0.10.5, passed 7,766 assertions in the full gate on amd64, the whole gate again under KASAN on arm64 with no report, every one of 1,054 crash points, about 79,000 hostile images with no finding, and 457 assertions in the two-node release suite on a three-node FC multipath rig. How cetrafs is tested has the details.

Out of scope

These are design decisions, not missing features: POSIX ACLs, special files (mknod), O_TMPFILE, chattr flags, RENAME_EXCHANGE and RENAME_WHITEOUT, cluster-wide byte-range locks, volumes spanning several LUNs, snapshots, big-endian hosts, and powering off hosts (the cluster manager’s job). See Limits and unsupported operations.

Planned, not built yet: rolling upgrades across a format change, and NVMe compare-and-write.

Before a first deployment

Check the two properties of your SAN that cetrafs depends on, atomic compare-and-write and coherent reads across hosts, then prove each layer before the next. Validate a storage stack before deployment walks through it, from the raw LUN to live-migrating VMs under load.

License

cetrafs is free software. Its two halves are licensed differently:

PartLicense
Kernel module (kmod/)GPL, version 2 or later (GPL-2.0-or-later). It links against the Linux kernel, so there is no other option for it.
Userspace tools (mkfs.cetra, fsck.cetra, defrag.cetra, growfs.cetra)AGPL, version 3 or later (AGPL-3.0-or-later), or a commercial license for those whom the AGPL’s source-availability terms don’t suit. Contact Massimo Cetra through GitHub.
On-disk format header (include/cetrafs.h)Any of the three, so each half can use it. The format itself is documented and anyone may implement it.

Each source file’s SPDX-License-Identifier line is authoritative for that file. See LICENSE in the repository.

This documentation is licensed under Creative Commons Attribution 4.0 (CC BY 4.0): you may copy and adapt it, including commercially, as long as you credit the source. The software and the documentation come without warranty; see Warranty and liability.

Neither license covers the cetrafs name or logo, which are trademarks of Massimo Cetra. See The cetrafs name and logo.

Last updated