Mirexa

Wiki Reference

Glossary

Every term the Mirexa wiki uses, defined precisely and linked to the page that explains it.

This page defines every term a reader meets in the Mirexa wiki. Definitions describe what the code does at the commit in the front matter; each links to the page that explains the term in full. Terms are alphabetical, and each heading is a stable anchor, so a page can link a term as reference/glossary.md#<term> (for example #in-sync-set).

A · B · C · D · E · F · G · H · I · L · M · N · O · P · Q · R · S · T · V · W

A

ACCEPTED

A gap status used only on INCOMPLETE marks: an operator has seen that a derived bar's source had a hole under it and keeps the bar as it is. An ACCEPTED mark is not fillable. See Derived streams and lineage.

Acknowledgement

The INGEST_ACK a node sends for a write. In ack mode it is sent only after the batch's WAL record is fsynced, so it is a durability receipt on that node. In a cluster, copies receive the write afterwards, asynchronously. See Durability and acknowledgements.

Admin token

A token carrying the ADMIN_CLUSTER permission, required on every control-plane call when control.admin_auth is on. See Authentication and tokens.

Admission

The step in which a joining node is added to the control plane's Raft group as a non-voter, before it opens storage. Also used for the hot cache's check that a live batch fits before it is logged. See Joining, draining and decommissioning nodes.

Ambiguous write

A write whose connection failed after it was sent, so it may or may not have been applied. The Go SDK reports it as wireclient.ErrAmbiguous and never retries it; the caller reconciles by reading back or by re-sending (re-sent stored bars are a no-op). See Writing data.

Anchor

The timestamp a stream's hot cache maps to its first slot; every slot is the anchor plus a whole number of intervals. The anchor lives only in memory, so a restarted cache relies on its floor until it re-anchors. See The hot cache.

Arena

The fixed-size, columnar block of slots that holds a stream's recent bars in memory, one slot per interval. A stream's arena size is derived from its timeframe and bounds the widest live batch it accepts. See The hot cache.

B

Backfill-on-subscribe

A subscription option that streams stored history first and then live bars, with no gap between them. The history window and the live queue overlap, so a bar can arrive twice. See Subscribing to live data.

Base chunk

A chunk holding a stretch of a stream's bars as first written. A patch names the base it corrects. See Chunks and compression.

C

Calendar

A stream's trading calendar: its weekly trading hours and declared closures, held as stream metadata and set with mirexa-cli calendar set or the control API. Gap classification reads it to tell market closure from lost data; changing it re-files the stream's gaps at once. See Gaps and trading calendars.

Candle

One bar of OHLCV data — timestamp (nanoseconds), open, high, low, close, volume — for one interval of a stream. Candles are ingested closed; Mirexa stores no in-progress bar. See Candles and ticks.

Catch-up

The process by which a copy brings itself level with its primary: a seed of flushed artifacts, then a tail of WAL records. See Replication.

Checkpoint

A periodic drain of every stream's hot cache to chunks (wal.checkpoint_interval, 15 minutes by default), after which WAL segments whose records are all in chunks can be reclaimed. See The write-ahead log.

Chunk

An immutable, compressed, checksummed file holding a contiguous run of one stream's bars (or trades) in columns. Chunks are listed in the stream's stream index and addressed by SeqNo. See Chunks and compression.

Circuit breaker

The per-node failure counter in the Go SDK's resilient client: after repeated transport failures it refuses requests to that node for BreakerCooldown (30s by default), then admits one probe. See Go SDK.

CLOSED

A gap status: the gap was filled with real data. The record is kept as provenance and no longer counts as missing time. Not fillable again. See Finding and filling gaps.

Codec

The column compression a chunk is written with: fixed_point_dod (default; fixed-point integers with bit-packed delta-of-deltas), gorilla (XOR floats) or none. Each chunk records its own codec. In a cluster the codec is a cluster setting. See Chunks and compression.

Cluster setting

A value every node of a cluster must agree on, replicated through the control plane: partition count, codec, liveness timeout and replication factor. All but the codec are immutable once agreed. See The control plane.

Compaction

Two different operations. Cache compaction evicts the oldest slots of a hot cache into a chunk (a flush). Index compaction removes a stream's oldest index entries and their chunks once the index exceeds storage.compaction_entry_threshold entries (50,000 by default); this is Mirexa's retention. See The hot cache and Indexes and the on-disk layout.

Contact point

An address a client or node uses for first contact with a cluster. Any node answers, by serving or redirecting; a contact point need not be the leader or a primary. Clients pass contact points to the routing client; nodes use seeds. See Partitions and routing.

Control plane

The Raft-replicated cluster metadata — node registry, partition directory, cluster settings, migrations, revoked keys — and the gRPC API that reads and changes it. Candle and tick data never pass through it. See The control plane.

Copy

A node holding a partition's data as a follower of its primary; also called a secondary. A copy is byte-identical to its primary's flushed state by construction, holds unflushed records in a replica log, and can be promoted. See Replication.

Correction

A write that restates bars a stream already holds, sent with the correction flag. It is the strict form of a restatement: it refuses any bar past the stream's newest data. See Corrections, restatements and history.

Cutover

The sequence that moves a partition's primary to an in-sync copy: drain the old primary's writes, finish the copy's catch-up, verify coverage, and commit one directory entry that names the new primary at a new epoch. See Moving partitions and rebalancing.

D

Data plane

Everything that carries candle and tick data: the client wire protocol, ingestion, storage, queries, subscriptions and node-to-node replication. Contrast control plane. See Cluster architecture.

Decommission

The final step of removing a node: once a drain has moved everything off it, its registry record becomes DECOMMISSIONED, it leaves the Raft group, and the node exits on its own. A decommissioned id is refused registration until an operator deregisters it. See Joining, draining and decommissioning nodes.

Derived stream

A stream whose bars are computed from another stream — trades into candles, or candles into longer candles — according to its lineage, and stored. See Derived streams and lineage.

Directory

The partition directory: for each partition, its primary, its copies, its in-sync set, its divergent copies and its epoch. Part of the control plane. See Partitions and routing.

Divergent copy

A copy that may hold a history its primary does not — every copy not promoted by a failover, or one whose seed reference disagrees. It serves nothing, is quarantined, and re-seeds from nothing. See Reconciliation, scrubbing and repair.

Drain

Two related operations. Draining a node (DrainNode) marks it LEAVING and moves its primaries and then its copies elsewhere. Draining a partition is the first step of a cutover: new writes are shed and in-flight writes finished. See Joining, draining and decommissioning nodes.

E

Epoch

A partition's fencing token: the Raft log index of the directory entry that installed its current primary. It changes only when the primary changes. Writes carry the epoch their sender believed, and a primary refuses an older one. See Partitions and routing.

Exchange

The venue component of a stream id (for example BINANCE). With the symbol it forms the partition key. See Streams, symbols and timeframes.

F

Failover

Automatic promotion of an in-sync copy when a primary has been fenced, after a delay of one liveness timeout so no lease the dead primary could hold is still running. Every other copy becomes divergent. See Failure detection, leases and failover.

Fan-out

A multi-stream query split across the nodes that serve its streams. Each node answers what it serves and redirects the rest in place; the client sends one leg per node. See Reading data.

Fence

The control plane marking a node OFFLINE after it has been silent for the liveness timeout. A fence names the node's incarnation, so a node that has since restarted is not fenced. A fenced primary's partitions fail over. See Failure detection, leases and failover.

Fillable

Whether a gap may be filled by writing data into it. Only an OPEN gap whose reason is not OFF_TIME is fillable; the node computes it (GapRange.Fillable) and clients display it as sent. See Finding and filling gaps.

Floor

The lowest timestamp a restarted, unanchored hot cache accepts: the end of the stream's newest chunk. It stops a live write landing inside flushed data. (In replication, a copy's floor is the highest SeqNo it already holds per stream.) See The hot cache.

Flush

Moving the oldest bars of a hot cache into a new chunk on disk, on flush_interval (5s by default) or when the cache fills. See The write path.

G

Gap

A run of intervals in a stream with no data, recorded in the stream's gap index with a status (OPEN, FILLING, CLOSED, PERMANENT, ACCEPTED) and a reason (for example network, exchange, OFF_TIME, INCOMPLETE). See Gaps and trading calendars.

Gap index

The per-stream file gap.idx listing a stream's gaps as ranges. Gaps are filed when chunks are written; a query also reports gaps still in memory. See Indexes and the on-disk layout.

Grant

The permissions a node gives a session at the handshake: the token's permissions (or, with authentication off, the client's request) clamped by security.max_permissions. Returned in INIT_ACK. See Permissions.

Group commit

Sharing one fsync among every write that arrived while the previous fsync ran, so many concurrent writers pay for few fsyncs. Mirexa's WAL acknowledges through it (wal.Writer.AwaitDurable). See The write-ahead log.

H

Handoff

The shutdown step in which a node sheds new writes, finishes those in flight, and lets every copy tailing it pull what it made durable, before it stops. See Startup, shutdown and recovery.

Heartbeat

A node's periodic message to the control-plane leader, every third of the liveness timeout. It renews the node's lease and carries its load report; it is not written to the Raft log. See Failure detection, leases and failover.

History back-fill

Bulk loading of historical bars through the history route (FlagHistory, mirexa-cli ingest -history), which stages and compresses them directly into chunks, including below data already stored. A write the live path cannot place is answered HistoryRequired. See Corrections, restatements and history.

Hot cache

A stream's in-memory, columnar store of its most recent bars, read together with chunks by queries and flushed to chunks as it fills. See The hot cache.

I

In-sync set

The copies of a partition currently level with their primary. A copy joins when it is level with the primary's durable watermark and leaves after 2 × liveness timeout + 2s without being level (unless the primary itself is down). Only in-sync copies are promoted or answer stale reads. See Replication.

Incarnation

The Raft log index of the entry that registered a node, renewed on every registration. A fence must name the current incarnation. See The control plane.

INCOMPLETE

A gap reason filed over a derived stream's bar whose source window had a hole. Unlike other gaps it covers slots that hold data: the bar is stored and returned with the mark. See Derived streams and lineage.

Interval

The duration of one bar, parsed from a stream's timeframe. Bars are aligned to the interval grid; weekly bars start on Monday. See Streams, symbols and timeframes.

L

Lease

A primary's time-limited licence to serve: an acknowledged heartbeat grants three quarters of the liveness timeout from its send time. Without one, a primary refuses reads and writes with PartitionUnavailable. See Failure detection, leases and failover.

Leader

The control-plane Raft member currently accepting proposals. It also runs the cluster's leader-local loops, among them fencing, failover, initial placement, drains, migrations, replication factor, rebalance planning and voter promotion. Not to be confused with a partition's primary. See The control plane.

Lineage

Stream metadata declaring what a stream is derived from (trades or a shorter candle stream), since when, and how existing history is treated (for example REDERIVE). Set only by its own call (mirexa-cli lineage). See Derived streams and lineage.

Liveness timeout

How long a node may be silent before it is fenced (cluster.liveness_timeout, 30s by default). A cluster setting, immutable once agreed; leases, failover delay and the in-sync window are derived from it. See Failure detection, leases and failover.

Load report

The per-partition levels (bytes, records, live writes ingested) a node sends with each heartbeat, from which the leader's rebalance planner computes balance and write rates. See Moving partitions and rebalancing.

M

Materialization

Computing and storing a derived stream's bars as its source changes, done only by the node serving the derived stream. See Materialization.

Migration

A recorded intent to move a partition's primary (or one copy) from a source node to a target. Progress is derived from the directory; the move itself ends in a cutover or, for a copy, add-then-remove. See Moving partitions and rebalancing.

N

Non-voter

A member of the control plane's Raft group that receives and applies the log but does not vote. Every node joins as one; the leader promotes caught-up non-voters toward cluster.voters. See The control plane.

O

OFF_TIME

The gap reason for intervals the stream's calendar says the market was closed. The live classifier files it as PERMANENT; whatever its status, an OFF_TIME gap is never fillable and is not counted as missing data. See Gaps and trading calendars.

OPEN

A gap status: missing data not yet addressed. The only fillable status. See Finding and filling gaps.

Overloaded

The error code (0x0007) for a shed request: refused before anything was stored, with a retry hint. Safe to re-send. See Error codes.

P

Partial result

A fan-out answer missing some nodes' sub-queries. The Go SDK returns the answers it has together with a *PartialResultError naming each failed node. See Go SDK.

Partition

The unit of placement in a cluster. Each stream maps to one partition by its partition key; each partition has one primary and zero or more copies. See Partitions and routing.

Partition key

The 64-bit FNV-1a hash of a stream's symbol and exchange; the timeframe is excluded, so every timeframe of a symbol shares a partition. Partition = key mod partition count (4,096 by default). See Partitions and routing.

Patch

A chunk that corrects a base chunk, placed directly after it in the stream index and holding every correction made to that base so far (cumulative). A read applies at most one patch per base. See Chunks and compression.

PERMANENT

A gap status: the gap cannot be filled (market closures are filed this way). See Gaps and trading calendars.

Permission

One bit of the grant bitmap a session holds: for example READ_CANDLES, WRITE_CANDLES, READ_TICKS, WRITE_TICKS, LIST_STREAMS, ADMIN_STREAM, ADMIN_CLUSTER. See Permissions.

Primary

The one node that serves a partition's reads and writes and that its copies replicate from. It serves only while it holds a lease. See Replication.

Promotion

Two uses. A copy's promotion makes it a partition's primary and replays its replica log before it serves. A voter promotion turns a non-voter into a voter. See Failure detection, leases and failover.

Q

Quarantine

A partition directory moved aside under quarantine/partition_<id>-epoch_<e>[-suffix] because the node must not use it (divergent, released or corrupt). Nothing in Mirexa deletes a quarantine. See Reconciliation, scrubbing and repair.

R

Rebalance

The leader's planning of primary moves that even out bytes and write rate across nodes. It plans continuously; it executes only when cluster.rebalance_auto is on. See Moving partitions and rebalancing.

Redirect

The REDIRECT frame (0x20) a node sends for a stream it does not serve, naming the partition, its epoch, the primary's id and its data address. It is sent before anything is dispatched, so following it is a first attempt. See Partitions and routing.

Replica log

A copy's per-partition log of WAL records tailed from its primary but not yet in seeded chunks. It is replayed when the copy is promoted. See Replication.

Replica read

A candle read served by an in-sync copy instead of the primary. The routing client spreads reads this way by default, within cluster.copy_read_max_staleness (5s). See Reads from copies.

Replication factor

The number of nodes that should hold each partition, primary included (cluster.replication_factor, default 1, range 1–7). A leader loop adds missing copies and never removes one; the factor is immutable once agreed. See Replication.

Restatement

A plain write onto bars the stream already holds. Each bar goes where it belongs — a patch for a flushed bar, a new version for a cached bar, an append for a new one — and a bar identical to what is stored is skipped. See Corrections, restatements and history.

Retention

The removal of a stream's oldest chunks when its index exceeds storage.compaction_entry_threshold entries (50,000 by default; 0 disables it). Copies mirror their primary's retention. See Indexes and the on-disk layout.

Rollup

Bars computed at query time from a stream's candles or trades by a derived stream's rules and stored nowhere (query flag 0x10, mirexa-cli query -rollup). See Deriving bars from ticks and candles.

Routing client

The cluster-aware Go client (wireclient.RoutingClient): it takes contact points, keeps a connection per node, caches routes with their epochs and follows redirects. See Go SDK.

S

Scrub

The background re-reading of a node's candle chunks at cluster.scrub_bytes_per_second (8 MiB/s by default) to find rot; a rotten chunk is repaired from a peer. See Reconciliation, scrubbing and repair.

Seed

The replication call that ships a partition's flushed artifacts (chunks, index entries, gap lists, metadata) to a copy, skipping what the copy already holds and checking that what it holds below its floor is the same history. See Replication.

Seed list

cluster.seeds: control-plane addresses a node uses for first contact with a cluster. Any member answers who leads. See Joining, draining and decommissioning nodes.

Segment

One file of the write-ahead log, up to wal.max_segment_bytes (512 MiB by default), with an 8-byte header. Segments whose records are all in chunks are reclaimed by the checkpoint. See The write-ahead log.

Secondary

Another name for a copy.

SeqNo

A chunk's sequence number within its stream: stable across compaction and restarts and never issued twice. Chunks are addressed by SeqNo, never by position. See On-disk formats.

Shed

Refusing a request before anything is stored — for example when the WAL buffer or hot cache is full — with Overloaded and a retry hint. The Go SDK re-sends shed reads and writes. See Error codes.

Stale read

A read that allows an answer from an in-sync copy (AllowStale), so it can be answered while the primary is down or not yet failed over. The result is marked stale and carries the time it was level. Ticks are never served stale. See Reads from copies.

Stream

One series of bars or trades, identified by exchange, symbol and timeframe. Streams are created on first write. See Streams, symbols and timeframes.

Stream index

The per-stream file stream.idx listing the stream's chunks in time order, with each one's SeqNo, time range, size and record count; format v5 also records the highest SeqNo ever issued. See Indexes and the on-disk layout.

Subscription

A long-lived request that pushes a stream's new bars to a client as they are ingested, in numbered batches; a dropped batch leaves a gap in the numbering. See Subscribing to live data.

Swap

A rebalance move onto a node that already holds an in-sync copy: the copy is cut over to primary and the old primary stays as a copy, so no data is copied and no copy is lost. See Moving partitions and rebalancing.

Symbol

The instrument component of a stream id (for example BTCUSDT). See Streams, symbols and timeframes.

T

Tail

The replication call that streams a primary's WAL records after a copy's watermark, keeping the copy level between seeds. See Replication.

Tick

One trade: a timestamp (nanoseconds), price and volume. Ticks are stored in their own chunks and WAL shards. A negative price is accepted (real markets have printed them); a negative volume is not. See Ticks.

Timeframe

The interval part of a stream id, written <number><unit> with unit s, m, h, d or w (for example 1m, 4h, 1d). See Streams, symbols and timeframes.

Token

An Ed25519-signed credential minted offline by mirexa-cli token, carrying permissions, a tenant id and an expiry of at most one hour. A session can renew it over its open connection. See Authentication and tokens.

TokenSource

A client option that supplies a fresh token on every connect and renewal (for example by re-reading a token file), so a long-running client survives token expiry. See Go SDK.

V

Voter

A member of the control plane's Raft group that votes and counts toward quorum. A cluster runs cluster.voters voters (3 by default; odd, 1–7). See The control plane.

W

WAL

The write-ahead log: an append-only, CRC-32C-checksummed log of every write, fsynced before the write is acknowledged and replayed after a crash. Candles share one log; ticks use wal.shard_count shards (16 by default). See The write-ahead log.

Watermark

A position in a log. A primary's durable watermark is how far its WAL is fsynced; a copy's tail cursor is the watermark it has applied, and it is in sync when level with the primary's. See Replication.

References

Source

Tests

Further reading