CortexDB · docs

CortexDB 0.11.0 — every write through a replicated log, cluster mode, and a one-way data upgrade

0.11.0 is a feature release on top of 0.10.5, the last published release. Everything in RELEASE_NOTES_0.10.5.md (and the notes before it) still applies; this page lists what changed since.

It is a one-way upgrade. Its first start migrates the data dir, a 0.10.x binary cannot open the dir afterwards, and the way back is a restore. Read "Before you upgrade" first. The one-click updater does not do this upgrade: do it by hand ("Upgrade").

For clients nothing is removed: the routes, the request and response shapes and the 11 capabilities are 0.10.5's. What a client can see is listed under "What changes for a single node".

Summary

Before you upgrade

Upgrade

From 0.10.5

  1. Read "Before you upgrade". Make sure nothing restarts the server on a newer image while you work (pin cortexdb/cortexdb:v0.10.5).
  2. Stop the server and give it the full stop grace (120 s): docker stop -t 120 cortexdb, or systemctl stop with TimeoutStopSec=120.
  3. Take a cold backup of the stopped data dir: python cold_backup.py backup DATA_DIR ARCHIVE, or a plain tar of the directory. It is the clean way back.
  4. If the dir still holds v1_wal/, or you run with CORTEX_UNIFIED_WAL=0, migrate first: cortexdb migrate-unified-wal --data-dir DATA_DIR --confirm, and drop the variable.
  5. Start 0.11.0 on the same dir, with the same environment (image cortexdb/cortexdb:v0.11.0).
    • DATA_DIR/pre_stage2/ appears: the rollback point. The log names it: Stage 2 rollback point taken, a warning under target cortex_wal, which the default RUST_LOG of the binary and of the image include (a RUST_LOG of your own shows it only with cortex_wal=warn in it).
    • The log reports each import: imported v1_idempotency claims into the shard, imported tenant maps into the shard and imported retention policies into the shard.
    • On a large dir this start takes longer; GET /v1/admin/ready answers 200 once it serves.
  6. Check:
    • GET /v1/admin/version: crate_version 0.11.0 and the git_sha you deployed; the same 11 capabilities as 0.10.5.
    • GET /v1/admin/ready: ready: true.
    • Before any write or recall, GET /v1/admin/metrics: vectors.embed_inputs is 0 (the first start embedded nothing; every write and every recall query adds to it).
    • A memory you know is found by GET /v1/events/{id} and by /v1/recall, and a retry of a recent write with its idempotency key replays it.
  7. Once you trust the release, delete DATA_DIR/pre_stage2/. It holds the event log as it was at the upgrade, erased events included, and every erasure reports log_residual_pending with the reason pre_stage2_retained until it is gone.

Docker Compose: set the image to cortexdb/cortexdb:v0.11.0 (or pull latest) only at step 5, and keep the pin afterwards.

From 0.10.4 or earlier

0.11.0 contains everything in 0.10.5. Read RELEASE_NOTES_0.10.5.md, "Upgrade from 0.10.4" (and from there the earlier notes) for what those releases change for clients and operators; then take the steps above, straight to 0.11.0. The way back is to the release you came from. The upgrade and both ways back were drilled from 0.10.1, 0.10.2 (pre_stage2/ only) and 0.10.5 data dirs.

The one-click updater after the upgrade

Once 0.11.0 serves, run the updater overlay from a 0.11.0 checkout, so the sidecar is rebuilt (docker compose -f docker-compose.yml -f docker-compose.updater.yml up -d --build). For a later one-way release, which its image declares (the io.cortexdb.one-way-below label; 0.11.0's image declares 0.11.0), the sidecar refuses the job with ONE_WAY_CONSENT_REQUIRED before CortexDB stops, the Updates page then asks for the operator's consent (accept_one_way), the backup is required, the first start's migration is waited for, and the old container is never started again on the migrated data.

Downgrade to 0.10.1 through 0.10.5

A 0.10.x binary cannot open a data dir 0.11.0 has served. There are two ways back, to the 0.10.x release you upgraded from. Both lose every write made since the upgrade and bring back every event forgotten or erased since it, so issue those forgets and erasures again on 0.10.x:

After a downgrade, starting 0.11.0 again upgrades the dir again from the start, with a new pre_stage2/ (drilled with 0.10.5).

0.10.2 to 0.10.5 store what 0.10.1 stores, plus 0.10.4's erasure receipts (erasure_job/ keys in v1_layers/) and cohort_alias.key. 0.11.0 reads both as they are; its receipts add one optional field, which 0.10.5 ignores. Both ways back were drilled with 0.10.1 and 0.10.5, and the pre_stage2/ way with 0.10.2 too.

What changes for a single node

Against 0.10.5. "0.10.x" below means every 0.10 release, 0.10.5 included.

Writes

Vectors

Forget, erasure and retention

Operations

Cluster mode (new)

cortexdb node --config FILE starts one process in one of three roles:

Nodes talk over mutual TLS with pinned keys. cortexdb admin places everything: it bootstraps the group, adds nodes, creates shards with 1 to 5 replicas, assigns scope roots, moves a root between shards (scope move), replaces a replica or a metadata voter, and restores a shard that lost its quorum. The cluster operator guide (docs/generated/cluster.md in the source tree) has the configs, the admin verbs, the error and exit codes, and the runbooks.

What it does:

Its limits in this release:

A single-node data dir cannot be adopted as a cluster shard: cortexdb node refuses it (exit 78 CLUSTER_DIR_FOREIGN). The one-click updater manages single-node Compose deployments only; a cluster is upgraded node by node, one binary per shard.

The 0.10.x features on the replicated log and on a cluster

Every feature of 0.10.1 to 0.10.5 is in this release and behaves on a single node as it does on 0.10.5, except where "What changes for a single node" says otherwise. Where they work differently here:

Environment variables

VariableChange
CORTEX_UNIFIED_WAL0, false or off exits 78 LEGACY_WAL_RETIRED (was: run the legacy dual WAL).
CORTEX_WAL_SYNC0 no longer weakens acknowledged writes; it only skips the fsync of derived_wal/ appends, with one warning at start.
CORTEX_BULK_DEFER_VECTORSRetired; set truthy it is ignored with one warning at start.
CORTEX_DRAIN_EMBED_CONCURRENCY, CORTEX_V1_MIRROR_MAX_IN_FLIGHTRetired; ignored.
CORTEX_CLUSTER_*Any non-empty value exits 78 CLUSTER_MODE_UNSUPPORTED (a cluster is configured in cortexdb node's config file).

No new variable is needed on a single node.

Error and exit codes

HTTP / exitCodeWhereRetriable
503NOT_LEADERAny write, refused before submit; never on a single node once it servesyes
503WAL_UNAVAILABLEAny write, and the status probe, while the shard is stopped or shutting down; nothing was writtenyes
503WAL_OUTCOME_UNKNOWNAny write submitted that may have committed (for example not committed within 10 s); retry with the same keyyes
413WAL_TOO_LARGEA vocabulary, temporal phrase or retention policy above 4 MiBno
422INVALID_ENVELOPEA capture record above 4 MiB less 64 KiB (per item in a bulk)no
409CANCELLEDA replay or wait of a write whose cancel committedno
500TENANT_MAP_STORAGEA vocabulary, temporal-phrase or retention-policy read that fails on storageno
exit 78LEGACY_WAL_RETIREDCORTEX_UNIFIED_WAL=0, or a data dir holding v1_wal/
exit 78CLUSTER_MODE_UNSUPPORTEDA cluster flag or CORTEX_CLUSTER_* variable on plain cortexdb
exit 78CLUSTER_DIRPlain cortexdb on a cluster data node's dir
exit 74WAL_FATALA storage or fsync error on the shard

INDEXING_FAILED (502) is now retriable: false. The cluster's own codes (SHARD_CATCHING_UP, SCOPE_MOVING, CROSS_SHARD_REQUEST, CLUSTER_ROUTE_UNSUPPORTED, ...) are in the cluster operator guide.

Measurements

Known issues

Clients

No client is re-released with 0.11.0. Every client published with 0.10.5 works against 0.11.0 unchanged, and the new codes carry retriable, which the SDKs already pass through.

PackageRegistryVersion to use
cortexdbai (Python SDK)PyPI0.12.0
cortexdbai (TypeScript SDK)npm0.10.1
cortexdb-mcpPyPI0.8.0
cortexdb-cliPyPI0.6.0
cortexdb-connectorsPyPI0.2.22

The source tree carries documentation-only edits to the Python SDK (docstrings of write_status, wal_status, wal_compact, forget_preview, erase and experience()), the TypeScript SDK (the ExperienceItem.labels doc comment) and cortexdb-mcp (memory_status's not-found text and the memory_store tags description). They ship with each client's next release.

Notes

POST /v1/experience?wait=settled is still accepted but cannot succeed and returns 503 SETTLEMENT_UNAVAILABLE. Use wait=indexed.

Single node remains the default topology; cluster mode is new and opt-in.