Repository navigation
Integrated storage (Raft) arrives, as EXPERIMENTAL. Start uBixVault with -storage raft (or storage.type=raft in the Helm chart) and three replicas keep and replicate their own data, with no MySQL to run. Selectable, rehearsed and measured, and still labelled experimental until the dev and prod soak. MySQL and file storage are unchanged and remain the default; backward-compatible with the 1.x API.
Image: ghcr.io/ubixsys/ubixvault:1.6.0 (multi-arch amd64/arm64). Helm chart: deploy/charts/ubixvault (adds storage.type=raft).
Upgrade notes
- Existing MySQL and file deployments need nothing.
- To adopt integrated storage, see Migrating from MySQL to Raft in
docs/DEPLOYMENT.md; for a new cluster, the chart README's "Deploying with Raft storage". - The top-level keys of the raft
configurationandautopilot/stateresponses are deprecated in favour ofdata.
uBixVault is a lightweight, open, Vault-API-compatible secrets manager: one small
Go binary, no plugin processes, Vault's request shapes so the vault CLI and
External Secrets Operator work unmodified. 1.6.0 adds the piece that most
separated it from Vault in a cluster: it can keep its own data.
Start it with -storage raft (or storage.type=raft in the Helm chart) and
three replicas form a cluster that replicates every write to a majority before
acknowledging it. No MySQL to provision, patch or lose. It ships as
experimental: we run it on our own dev and then prod first, and the label
comes off after that soak.
What you get
- A replicated store with no external dependency. Each replica has its own
volume; any one can be lost. Two down means no quorum, so writes fail rather
than diverge. - The same operations. Auto-unseal, snapshots, the backup CronJob and the
rolling upgrade work as before;operator raftadds peers, join tokens,
snapshots and recovery, and the raft endpoints use Vault's response envelope
sovault operator raft list-peersworks. - Explicit joining. A new replica joins with a single-use, short-lived token
against a pinned CA; peer traffic is mutually authenticated TLS. - A way over from MySQL. One maintenance window: export the ciphertext from
the database, restore it into the first replica's volume, start with the same
unseal key, join the others. Nothing above storage changes, so no token,
lease or secret is invalidated, and rollback is a snapshot back into the
database.
What we measured
On kind, three replicas, a client writing every 100 ms through the Service with
no retries, and every acknowledged write checked afterwards:
| Event | Result (range over three runs) |
|---|---|
| Leader's node frozen | another leader in 6-7 s |
| Leader partitioned from the majority | new leader in 11-17 s; the isolated leader answered 503 to every write |
| Acknowledged writes (every run) | all read back from the Service and every replica (93/93, 85/85, 71/71 at that stage) |
| Whole cluster restarted (PVCs kept, auto-unseal) | serving again in 18 s, nothing lost |
One replica's volume wiped (-2) |
back as a voter in 19 s |
Pod -0 on a wiped volume |
refuses to found a second cluster under its old identity; given a join token it rejoins with the configuration intact |
The same write, read and list load through the same Service, MariaDB against
Raft (zero errors; the Raft term did not move, so the 500 ms leader lease held):
| Load | MariaDB p50 / p99 ms | Raft p50 / p99 ms |
|---|---|---|
| write, 1 client | 4.5 / 6.2 | 4.5 / 6.7 |
| write, 8 clients | 13.4 / 24.2 | 14.9 / 30.9 |
| read, 8 clients | 7.9 / 18.3 | 5.1 / 28.8 |
| list 100 keys, 4 clients | 4.6 / 8.9 | 3.5 / 6.9 |
Writes cost about what a MySQL round trip does. These are CI-VM numbers: a
regression baseline, not capacity planning.
The MySQL-to-Raft migration was rehearsed end to end both on the same Helm
release (--cascade=orphan) and as a parallel release: 48 of 48 entries
present, 33-35 s from freezing the old release to the first read served by
Raft, and a rollback (41-46 s) that brought MySQL back with a write made on
Raft intact.
The tests earned their keep: the chaos run found that a bootstrapped node's
address was stored as a pod IP rather than its DNS name, and a Jepsen-style
checker found that a newly elected leader could answer a consistent read from a
state machine that had not applied the previous leader's last entries. Both are
fixed in 1.6.0.
Jepsen-style testing, stated plainly: three 2-minute runs of about 100,000
operations each found no violation, but the checker could not decide every
window of the history (it gave up on its step budget on all three keys), so
this is not a proof of linearizability. Widening that coverage is open work.
What to know before you use it
- It is a new storage engine and it is experimental. MySQL and file storage
are unchanged and remain the default; migrate when you have a window and a
recent snapshot, and keep the database for the soak. - uBixVault has had no independent security audit. That is still the open
milestone. - Run 3 or 5 replicas (the chart refuses an even number). Use block storage
with realfsync, not NFS/SMB. - Auto-unseal is the practical mode: a sealed replica does not vote, so a full
restart under Shamir shares needs operators to unseal a quorum first. - It is not Vault's integrated storage byte for byte: autopilot is membership
and leader only, and a few shapes differ (docs/design/raft-storage.md). - The top-level keys of the raft
configurationandautopilot/stateresponses
are deprecated in favour ofdata.
Changelog
Integrated storage (Raft) ships as experimental in this release: selectable,
rehearsed and measured, still carrying the label until the dev and prod soak.
Added
-
Raft chaos suite, migration rehearsal, baseline and Jepsen-lite. kind
scenarios (leader freeze, partition, full restart, PVC loss, wiped pod-0)
with a no-retry writer whose acknowledged writes must all survive; the MySQL
to Raft migration and rollback rehearsed both with--cascade=orphanand as a
parallel release; a MariaDB-vs-Raft write/read/list baseline with a leader
lease check; an in-process Jepsen-lite (concurrent clients, crashes,
partitions, per-key linearizability checker) inmake cias a smoke and
nightly for 10 minutes. Workflowsraft-chaosandraft-jepsen. -
operator raft export-mysqlandoperator raft digest. Read the
ciphertext straight out of a MySQL database (no unseal) into a snapshot with an
entry count and SHA-256, and compare a snapshot of the migrated cluster with it.
DEPLOYMENT.mdgains "Migrating from MySQL to Raft" and "Replacing a Raft
replica whose volume was lost". -
-raft-peersbootstrap guard. A Raft node that would bootstrap on an empty
data directory first asks its peers; if one reports an initialized cluster it
refuses (or joins, given a token), so a pod-0rescheduled onto a wiped volume
cannot found a second cluster under its old ID. The chart sets it. -
Helm chart:
storage.type=raft. A three-replica integrated-storage cluster
from the chart: StatefulSet with a PVC per pod and stable DNS identities via a
headless Service, pod-0bootstraps and the others join with single-use
tokens, PodDisruptionBudget and anti-affinity as for HA, and an optional
NetworkPolicy for the cluster port.fileandmysqlrenderings and the
filedefault are unchanged. A kind e2e (raft-e2eworkflow) brings up three
nodes, writes, force-kills the leader and reads back. Docs: chart README,
DEPLOYMENT.mdRaft upgrade section. -
Raft integrated-storage backend (experimental, not yet selectable)
(internal/storage/raft, ADR D-023, design indocs/design/raft-storage.md):
hashicorp/raftwith a bbolt state machine behindstorage.Backend, snapshots
in theubixvault-snapshot v1format, and internal membership operations. It is
exercised only by in-process tests: there is no-storage raftflag, operator
API, peer TLS or chart support yet, so nothing changes for any deployment. -
Raft storage implements
HABackend(not yet selectable: the-storage raft
flag is a later slice). Raft leadership is the HA lock and the term is the
fencing generation; releasing the lock transfers leadership. A replica whose
Raft state machine fails permanently now seals itself and reports the failure
(Core.HAFailed) instead of retrying. -
-storage raft(experimental): select the Raft backend with
-storage raft -data <dir>and-raft-node-id,-raft-advertise-addr,
-raft-bootstrap=false(nodes that will join). The cluster listener now
multiplexes Raft and request forwarding by ALPN, authenticated by the
sys/ha/cluster-caidentity; a sealed replica does not vote. HA is implied.
operator snapshot restore -storage raftrestores offline into an empty data
directory. Newubixvault_raft_*gauges on/v1/sys/metrics. Library side of
joining: 24h bridge leaf for a sealed joiner and non-voter to voter promotion. -
Raft operator API and CLI (experimental):
sys/storage/raft/join,
join-token,configuration,remove-peer,snapshot(GET save / POST
restore),snapshot-forceandautopilot/state, andubixvault operator raft list-peers | join | join-token | remove-peer | snapshot save|restore|force-restore | autopilot-state. A new node joins declaratively with-raft-retry-join,
-raft-join-token-file(or$UBIXVAULT_RAFT_JOIN_TOKEN) and
-raft-leader-ca-cert; a non-voter reports its applied index to the leader so
it is promoted. The bridge credential is kept in<data>/raft/bridge.json
(0600) until the first unseal, so a restart before then does not need a new
token.join-acceptandreport-appliedare internal endpoints. -
Raft quorum-loss recovery and cluster-CA rotation (experimental):
ubixvault operator raft recover -data <dir> -peers <file>stages a
peers.jsonon a stopped node, which the next start applies once and deletes
(writes acknowledged only by dropped members can be lost).operator raft rotate-ca/POST sys/storage/raft/rotate-ca(sudo, leader) replaces the
cluster CA; every node must then be restarted and unsealed to pick it up
(runbook indocs/design/raft-storage.md).
Fixed
- Raft: the advertised address was resolved to a pod IP.
NewMuxTransport
resolved the DNS name it was given and the bootstrap entry stored that IP in
the Raft configuration, so a bootstrapped node (pod-0) was recorded at an
address that is stale after the first reschedule. The name is kept. Found by
the chaos suite. - Raft: a newly elected leader could answer
ConsistentGetfrom a state
machine that had not applied the previous leader's tail, returning an
overwritten value. It now applies a barrier in its own term before the first
consistent read. Found by Jepsen-lite. sys/storage/raft/configurationandautopilot/stateanswer in Vault's
dataenvelope, sovault operator raft list-peersand clients built on
Vault's API read them. (Other lane.)- raft e2e: the install waited on a pod before it existed; the checks read
the old response shape.
Deprecated
- The top-level keys of the raft
configurationandautopilot/state
responses (config,servers, ...) are still emitted next todataand will
be dropped onceinternal/clientreadsdata.
Changed
- CI: a GitLab merge-request pipeline mirrors the GitHub CI (lint, build and
test, integration, vulnerability scan, console end-to-end). No product change. - Storage keys must be valid UTF-8 on every backend (
storage.ValidateKey),
matching what the Raft backend already enforced. Barrier paths are ASCII, so no
existing store is affected.
Security assurance (read this)
uBixVault has not yet undergone an independent third-party security audit. Its cryptography and trust path are standard-library Go, written in-house, fuzzed, and property-tested, but that is not a substitute for outside review, which is an active, open milestone, deliberately not a version gate (docs/VERSIONING.md). Weigh that before placing high-blast-radius secrets here.
Full history: CHANGELOG.md. Design and measurements: docs/design/raft-storage.md.