Mirexa

Wiki Design

Known limitations

What Mirexa does not do, or does not guarantee, today — with the impact of each, a workaround where one exists, and where it is in the code.

This page lists what Mirexa does not do or does not guarantee at the commit in the front matter. Some items are open defects, some are measurements nobody has taken yet, and some are deliberate choices with a cost; each says which. A limitation stated plainly is worth more than a feature implied, so if you are deciding whether Mirexa fits a workload, read this page first.

Each entry gives the impact, a workaround where one exists, and a reference to the code or test that defines the behaviour. Reasons for deliberate choices are in Design decisions.

Summary

Durability and availability in a cluster

A crash can lose recently acknowledged writes

A clustered primary acknowledges a write once it is durable in its own write-ahead log; copies pull it asynchronously. If the primary crashes before a copy has pulled a write, and that copy is promoted, the write is gone.

  • Impact. Bounded by the in-sync window: a promoted copy was level with its primary within 2 × liveness_timeout + 2s (InSyncStaleAfter), so nothing older than that is lost. In practice the loss is about one tail poll. Measured 2026-10-20 on one development laptop with benchmarks running, seven runs: 0–110 acknowledged candles lost at roughly 600–2,300 acknowledged candles/s, and 0–3,000 (up to six 500-candle batches) at roughly 98–128K/s, every lost candle acknowledged 2–40 ms before the kill.[1] This is a sample, not a distribution.
  • Not affected. A graceful stop (SIGTERM) hands off first and loses no acknowledged write; a graceful cutover loses none; a single-node deployment loses none to a crash (its WAL is replayed).
  • Workaround. None inside Mirexa. Clients that cannot tolerate the window should keep their source data until it is old enough, and re-send (re-sending stored bars is a no-op).
  • Reference. InSyncStaleAfter in /internal/cluster/lease.go; TestServerBinary_ACrashedPrimaryLosesOnlyWritesItsCopyHadNotPulled (/tests/server_binary_crash_loss_test.go), TestServerBinary_ASigtermedPrimaryUnderLoadLosesNoAckedWrite.

A cutover under heavy load freezes its partition

Moving a partition's primary freezes the partition's writes first and then finishes the copy's catch-up. A copy counts as in-sync while seconds behind, so under heavy load the freeze lasts as long as the copy's lag.

  • Impact. No acknowledged write is lost — shed writes are re-sent by the SDK and land on the new primary — but the partition accepts no write for the freeze. Measured 2026-10-10 on a development laptop: 17.3s at 133K acknowledged candles/s, 31.5–32.4s at about 290K/s (one run: 1.1s drain, 11.1s final seed, 18.2s final tail).[2]
  • Workaround. Move partitions when write load is low, or with rebalance_auto off and moves applied by hand at a quiet time. The standard remedy, iterative pre-copy (converge while the primary still serves, freeze only for the last delta), is not built.
  • Reference. TestServerBinary_APartitionTakingAHundredThousandWritesASecondMovesAndLosesNoAckedWrite (/tests/server_binary_cluster_test.go). See Moving partitions and rebalancing.

Failover takes about two liveness timeouts

A dead primary is first fenced (after one liveness timeout of silence), then failed over after a further FailoverDelay (one liveness timeout) so that no lease it could still hold is running.

  • Impact. At the default cluster.liveness_timeout of 30s, a dead primary's partitions are unavailable for about a minute. Measured 2026-10-08 in the shipped binary at T=3s: fenced 2.9s after a SIGKILL and failed over 3.97–4.97s after the fence.[3]
  • Workaround. Reads that set AllowStale (or replica reads, the routing client's default) are answered by an in-sync copy during the outage. A smaller liveness timeout shortens it, but the timeout is fixed when a cluster is founded.
  • Reference. FailoverDelay, LeaseDuration in /internal/cluster/lease.go; TestServerBinary_ADeadPrimaryIsFailedOverToItsCopy, TestStaleRead_ACopyAnswersWhileItsPrimaryIsDown. See Failure detection, leases and failover.

Primaries stop serving without the control plane

A clustered primary serves only while it holds a lease renewed by acknowledged heartbeats. If it cannot reach a control-plane leader with a quorum, it refuses reads and writes (PartitionUnavailable) within three quarters of a liveness timeout. A copy without a lease answers no stale read either.

  • Impact. Losing control-plane quorum stops data service cluster-wide. This is deliberate: a primary that cannot be vouched for cannot rule out that it has been replaced.
  • Workaround. Run 3 or 5 voters (cluster.voters) on independent hosts.
  • Reference. TestServerBinary_APrimaryStopsServingWhenItsControlPlaneIsGone, TestStaleRead_ACopyWithoutALeaseAnswersNothing. See Design decisions.

Storage and data management in a cluster

A migration frees no disk on the source

When a partition moves away, the source keeps its chunk files, indexes and metadata. Once it sees its role has ended it moves them under quarantine/…-released; it deletes nothing.

  • Impact. Disk use grows with every move off a node, without bound across repeated rebalances. The files are inert (every read and write is redirected).
  • Workaround. After confirming the partition is healthy on its new primary, an operator may remove the quarantine directory by hand.
  • Reference. Layout.QuarantinePartition in /internal/storage/layout.go; TestLayout_QuarantinePartitionMovesEverythingAndDeletesNothing.

Nothing deletes a quarantine

Divergent copies (-diverged), released partitions (-released) and partitions with a corrupt index found at startup (-corrupt) are moved under quarantine/ and kept.

The replication factor cannot change, and only adds copies

cluster.replication_factor is agreed once and is immutable. Its loop adds missing copies and never removes one.

  • Impact. There is no way to raise or lower the factor of a running cluster, and surplus copies (from aborted migrations, or added by hand) are never removed automatically. Copies on a node that stays offline still count as present and are not replaced.
  • Workaround. Drain a dead node (DrainNode) so its copies are moved. The control API has no call that adds or removes one copy alone; AssignPartition rewrites a partition's whole copy list and resets its in-sync set, so use it with care.
  • Reference. PlanReplication in /internal/cluster/replication.go; TestSettings_ReplicationFactorIsValidatedAndImmutable.

Cluster settings cannot be changed on a running cluster

Partition count, liveness timeout and replication factor are immutable once agreed; the codec can be updated but a running node does not adopt it until restarted. There is no hot reload of cluster settings.

  • Impact. Choose these when founding a cluster. With cluster.strict_settings off (the default), a node that cannot read agreed settings within settings_timeout starts on its own YAML and logs it loudly, running on those values until restarted.
  • Workaround. Set cluster.strict_settings: true where a split configuration is worse than an unavailable node.
  • Reference. /internal/cluster/settings.go; TestSettings_PartitionCountIsImmutableOnceAgreed, TestSettings_LivenessTimeoutIsAgreedOnceAndNeverChanges.

No zone or rack awareness

Node records carry no topology. Copy placement and rebalancing choose nodes by load and id only.

  • Impact. A partition's copies may sit in the same failure domain as its primary.
  • Workaround. Where failure domains matter, set a partition's copies explicitly with AssignPartition (which resets its in-sync set until the copies catch up again).
  • Reference. /internal/cluster/replication.go (no topology fields exist in cluster.Node).

Ticks are not scrubbed, repaired or read from copies

Flushed tick chunks replicate and fail over with their partition, but the background scrubber reads only candle chunks listed in stream.idx, so a rotten tick chunk is found only when read. A stale (copy) read never returns ticks.

Unmeasured performance targets

These have never been measured:

  • one million writes per second across ten nodes;
  • p99 latency with 100 concurrent clients;
  • read throughput gained by reading from copies on separate hardware (on one shared machine the gain was within noise, 2026-10-23);
  • the cost of a feed that prints late ticks constantly (each rewrites a whole chunk per flush);
  • bulk loading a year of data for 50 symbols.

Treat any claim about them as unverified.

Every node

No node-wide in-flight byte budget

Write-ahead-log buffers are bounded per writer (wal.max_buffer_bytes, 4 MiB by default, per shard plus one), and each stream's hot cache is bounded. Nothing caps memory across all streams of a node.

  • Impact. Many active streams can together outgrow memory.
  • Workaround. Size ingestion.live_candle.cache_span / cache_arena_capacity and the number of streams per node with memory headroom; run with a memory limit and monitor it.
  • Reference. /internal/config/config.go.

Nothing bounds a timestamp

A candle's timestamp is validated for shape and alignment but not against the clock.

  • Impact. A bogus bar far in the future is accepted on a drained stream, and then the real next bar is too old for the hot cache (it becomes a restatement or is refused).
  • Workaround. Validate timestamps in the feed handler before writing.
  • Reference. /internal/types/candle.go.

Subscriptions carry closed bars only, and may repeat one

The partials subscription flag is refused with Unsupported; only closed bars are sent. The hand-off from backfill to live guarantees no gap, not no duplicate.

A clean stop drains streams one at a time

On a clean stop each stream's hot cache is flushed to a final chunk, one stream after another, each with its own chunk write, index write and fsyncs.

  • Impact. Measured 2026-10-20 on a development laptop's NVMe with other benchmarks running: a node holding 1,000 streams took 45.4s to stop, one holding 100 took 4.0s — linear, about 45 ms a stream. A node with tens of thousands of streams would exceed a typical orchestrator grace period. A stream's first acknowledged write costs a similar order (about 20 ms).[4]
  • Workaround. Give the process a long stop grace period. If it is killed mid-drain, no data is lost — the WAL is replayed — but the next start is slower.
  • Reference. Dispatcher.Stop in /internal/ingestion/dispatcher.go.

Idle connections hold shutdown for its whole timeout

The listener waits up to network.shutdown_timeout (30s) for every connection to finish, and an idle connection (a client waiting to send its next frame) never does.

  • Impact. A node with any connected routing client, dashboard or subscriber takes the full timeout to stop, then force-closes the connections. A rolling restart pays it per node.
  • Workaround. Lower network.shutdown_timeout, or set the orchestrator's grace period above it plus the stream drain time. Data is safe in the WAL either way.
  • Reference. Listener.Stop in /internal/network/listener.go.

Older formats are refused, not upgraded

A file or snapshot of an older format version (stream.idx before v5, a control-plane snapshot before v12) is refused, and a protocol v2 node does not speak protocol v1.

Security

A cluster must be given its issuer keys

Authentication is on by default, and a single node with no security.auth.trusted_keys generates its own issuer and admin token. A clustered node cannot: each would trust a different key, and a token from one would be refused by the node it is redirected to. A node with cluster.enabled: true, authentication on and no trusted keys is refused at config load. The gRPC control plane's own check, control.admin_auth, is separate and still off by default; with it off the control listener binds loopback only.

  • Impact. A cluster cannot start on defaults alone.
  • Workaround. Mint a keypair with mirexa-cli token keygen and list the same public key on every node, or set security.auth.enabled: false where every client is trusted.
  • Reference. authConflicts in /internal/config/validate.go (TestAuthConfig_EnabledWithNoKeysIsRefusedInACluster). See Authentication and tokens.

Tenancy is not enforced

Tokens carry a signed TenantID, but nothing scopes data by it. The only use is that a token renewal must keep the same tenant.

  • Impact. Every authenticated client with the right permission sees every stream on the node.
  • Workaround. Run separate deployments per tenant.
  • Reference. /internal/network/reauth.go.

Individual tokens cannot be revoked

Only an issuer key can be revoked (through the control plane). A leaked token remains valid until it expires (at most one hour).

Clients and ecosystem

Client-side timing floors

  • A routing client whose circuit breaker opened while a node was down refuses that node for ResilienceOptions.BreakerCooldown (30s by default) after it returns.
  • Node-to-node connections detect a silent peer no faster than about 10s plus the keepalive timeout: the gRPC library floors the client keepalive interval at 10s regardless of the option.

Reference. /internal/wireclient/resilient.go, /internal/replication/pool.go; TestPool_KeepaliveNoticesAPeerThatGoesSilent.

SDKs exist for Go and Python only

The Go SDK lives in this repository (client); the Python SDK is a separate repository. Other languages can use the frozen conformance suite (conformance/wire-v2.json) to implement the protocol, but no other SDK exists. See Go SDK and Python SDK.

No distributed tracing

Mirexa exports Prometheus metrics and structured logs; it has no tracing instrumentation.

References

Source

Tests

Further reading

External

  • Martin Kleppmann, Designing Data-Intensive Applications, O'Reilly, 2017 — chapter 5 on asynchronous replication and failover loss; see Bibliography.

  1. Measured 2026-10-20 by TestServerBinary_ACrashedPrimaryLosesOnlyWritesItsCopyHadNotPulled, seven runs at two loads on one development laptop with benchmarks running; recorded in the repository's internal notes, not re-run for this page. ↩︎

  2. Measured 2026-10-10 by TestServerBinary_APartitionTakingAHundredThousandWritesASecondMovesAndLosesNoAckedWrite on a development laptop; recorded in the repository's internal notes. ↩︎

  3. Measured 2026-10-08, three runs, by TestServerBinary_ADeadPrimaryIsFailedOverToItsCopy with a 3s liveness timeout. ↩︎

  4. Measured 2026-10-20 by the ten-node fan-out test (TestFanOut_TenNodesAnswerAThousandStreamsAsOneNodeHoldingThemAllDoes) on a development laptop with other benchmarks running. ↩︎