HA rolling upgrade
Это содержимое пока не доступно на вашем языке.
Procedure for upgrading Chronacta nodes in a cluster without losing committed events.
Preconditions
Section titled “Preconditions”- Cluster mode enabled (
mode=clusterindata/cluster/cluster.json). - Healthy quorum: at least half of voting members reachable.
- Backup or snapshot taken from the current leader before starting.
Consistency during upgrade
Section titled “Consistency during upgrade”- Client writes go only to the leader; followers reject writes with
FailedPrecondition. - A write is acknowledged after local commit and quorum replication to followers.
- Follower reads are eventually consistent; use the leader for strong reads during upgrade.
Rolling upgrade steps
Section titled “Rolling upgrade steps”- Identify leader —
chronacta cluster statuson any node; noteleader_idandepoch. - Upgrade followers first — stop one follower, replace binary, restart with the same
data/directory. - Wait for catch-up — confirm
replication_lagreturns to0viacluster status. - Transfer leadership (optional) —
chronacta cluster promote -node-id FOLLOWERfrom the current leader before upgrading it. - Upgrade former leader — stop, replace binary, restart; node rejoins as follower.
- Verify cluster —
cluster statusshows expected membership, epoch incremented if leadership moved, lag near zero. - Smoke test — append and read from the new leader; confirm followers catch up.
Snapshot before major upgrades
Section titled “Snapshot before major upgrades”Push a snapshot marker to each follower from the leader:
chronacta cluster snapshot push -target-node-id FOLLOWER_IDSnapshots are stored under data/cluster/snapshots/ on the follower. Full engine restore from snapshot is documented in Replication architecture; snapshot metadata is stored for recovery planning.
Membership changes during upgrade
Section titled “Membership changes during upgrade”Add a new node before decommissioning an old one:
chronacta cluster add-node -node-id NEW -addr HOST:PORT -role followerRemove the old node only from the leader:
chronacta cluster remove-node -node-id OLDRemoving the current leader is rejected; promote another node first.
Rollback
Section titled “Rollback”If a new binary fails health checks:
- Stop the upgraded node.
- Restore the previous binary and the same
data/directory (or restore from backup). - Rejoin the cluster; followers catch up via AppendEntries.
Automated coverage: pkg/server/ha_fault_injection_test.go (leader kill, snapshot transfer, promote/epoch, corrupt snapshot rejection).
HA test suite: pkg/server/ha_commercial_test.go — sustained append, long chaos (CHRONACTA_CHAOS_FULL=1), and rolling upgrade scenarios.
Rolling upgrade when a format migration is required
Section titled “Rolling upgrade when a format migration is required”After upgrading binaries, run offline migration on each stopped node before restart:
./bin/chronacta migrate -data-dir /var/lib/chronacta/dataOrder: followers first, then optional cluster promote, then former leader — same as binary-only upgrade.

