Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Archive tabs

ergo-aeron reads an Aeron Archive two ways, apart or together:

SourceFlagTab and subcommandsWhat it touches
Online--control URI (--control-stream, --control-response)Recordings and Payload; recordings, recording ID, replay IDa control session on the archive, read requests only, through an Aeron client on the attached driver (or the tool’s own with --embedded); a replay also subscribes to what the archive sends back
Offline--archive-dir DIRArchive dir; archive-dir ...the directory’s files, opened read-only; the archive may be running or stopped
Countersthe attached driverrecording-lag, the Recordings tab’s lag column, and the Recordings tab itself when the counters show an archivethe archive’s driver’s cnc.dat, as the other tabs read it

The archive tabs appear only with their source. A missing driver does not stop the Archive dir tab from opening, and a missing archive does not stop the driver tabs. Nothing here writes: no archive action is in writer mode yet, and every command below is in the read list that the write gate’s test walks.

An archive seen in the counters

In the terminal UI, without --control, the tool looks at the attached driver’s counters for an archive’s own (type ids 100 to 113: recording positions, error and cycle counters, control sessions). When there is one, the top line says archive N detected and the Recordings tab appears with what the counters hold and nothing else: recording id, archive, stream, session, recording position, the stream’s position and the lag. Only recordings being written have a counter, so stopped ones are not listed. No client is added to the driver.

c (or F12) opens the control session, on aeron:ipc and the --control-stream id (10 by default): the counters are on this driver, so the archive records through it. c again asks for another control channel, typed and then Enter (Esc cancels). The tool never connects by itself. A session that fails keeps the counter rows on screen and shows the reason.

With --aeron-dir and --embedded together the session goes through the tool’s own driver, which an aeron:ipc channel cannot reach, so c asks for the channel at once. --control keeps its meaning: the session is opened at start and the counters-only view is not used.

Online: the control session

ergo-aeron --aeron-dir /dev/shm/aeron --control 'aeron:udp?endpoint=archive-host:8010' recordings
ergo-aeron --aeron-dir /dev/shm/aeron --control aeron:ipc recording 3

recordings lists what the archive’s catalogue holds (--channel TEXT --stream N filters, --from and --count page; at most 10000 per request) with the same columns as the offline listing below. When --count (1000 by default) leaves recordings out, a line on standard error says how many and which id to give --from for the next page (or more when the request itself was full). recording ID prints one descriptor with its four positions: start, stop (- while recording), recording position (- when not recording) and the highest position recorded.

The session is not passive. Connecting adds an Aeron client to the driver it goes through and a control session to the archive, whose responses come back on a subscription addressed to this tool alone (--control-response, by default aeron:ipc for an IPC control channel, else aeron:udp?endpoint=localhost:0, Aeron’s own default). The requests are the listings, the position queries and, for a payload, the replay; the java lane’s tests read the archive’s control stream while the tool runs and fail on any other request.

That response subscription is the one subscription of the tool that does not carry the viewer’s guards (reliable=false, tether=false, the short untethered timeouts, Attached or embedded). The guards exist so that a receiver joining a stream other receivers share cannot slow its publisher. Nobody shares this stream: the archive sends the responses to this session only, and a response lost to reliable=false would fail the very request that asked for it. The tool says so on the channel (tether=true, and reliable=true on UDP, unless --control-response already says): its own driver in embedded mode defaults every subscription to the guards. A replay’s subscription says the same.

Which driver the client goes through:

GivenThe session goes through
--aeron-dirthat driver, which so gains a client
--embeddedthe tool’s own driver
boththe tool’s own driver: the driver tabs and recording-lag still read --aeron-dir, which gains no client

An aeron:ipc control channel exists only inside the archive’s own driver, so with --embedded it is refused before anything starts: name the driver with --aeron-dir and leave --embedded out. Reach a remote archive through --embedded and a UDP control channel, and give --control-response 'aeron:udp?endpoint=THIS-HOST:0' with an address of this host that the archive can reach: the default response channel, localhost:0, would have the archive send its responses to itself, and the connection would time out.

The Recordings tab does not list the archive on every refresh. Each listing (at most 10000 recordings) is answered by the archive’s conductor, which with shared threading is also its recorder, so the tab lists everything once when it opens and once a minute after that. Between those it asks only for the recordings after the highest id it knows and, one request each, for the recordings that have not stopped yet. It waits at least one second between refreshes whatever --interval says. A recording deleted from the archive stays in the tab for up to a minute. Past 10000 recordings the tab shows the first 10000 and says so in its status line; recordings --from ID lists the rest.

The tool sends no credentials, and has no way to be given any: an archive that authenticates its clients refuses the session. A control channel with a parameter that is not one of Aeron’s own (where a credential might have been typed) has that value shown as *** in every message, and is never kept in the history.

Building without the control reader

The control reader is the cargo feature archive, on by default. It is the one part of the crate that needs rusteron’s archive client, whose build runs Aeron’s Gradle and so needs a JDK 17 or newer. Without it (--no-default-features --features cli,tui,static) the crate builds with no JDK; recordings, recording and the Recordings tab’s --control then say built without the archive control reader and exit 2 (the Recordings tab shows the same line), and replay says the same. archive-dir, recording-lag and every driver tab work in both builds.

Payload: replaying a recording

ergo-aeron --control aeron:ipc replay 3 --schema schemas/
ergo-aeron --control aeron:ipc replay 3 --from 4096 --length 1048576 --format raw > part.bin
ergo-aeron --control aeron:ipc replay 3 --follow --format compact

replay ID asks the archive to send the recording back to the tool and prints its messages as messages prints a stream’s: the same formats, --schema, --interpret and --converters. Without --follow it prints what the recording holds when it starts, and exits. With --follow it goes on as the recording grows and exits when the recording stops. --from POSITION must be where a frame starts (a position replay or archive-dir dump has printed); --length BYTES stops after that much of the recording. A position outside the recording, or one inside a frame, is refused with the reason (exit status 2). So is a replay cut off: the driver closing the tool’s client, or the replay ending before the length asked or, with --follow, while the recording goes on. Ctrl-C or SIGTERM ends --follow cleanly.

In the terminal UI, w (or F4) on a recording of the Recordings tab replays it onto the Payload tab: from the start of the term that holds the byte 1 MiB before the end (only a term’s start is known to be a frame), then live while it records. The tab has what the Messages tab has: the list filter (/), the preview with its regular expression search (Enter, then /), the counts per message type, i and Space. It keeps the newest 5000 messages, and the filter searches those. w on another recording starts again.

A replay is a read: the archive reads its files and sends them, and no recording changes. It does cost the archive that work. What it touches:

WhatHow
Sessioneach replay opens its own client and control session, beside the listing’s, and closes them when it ends
Where it is sentthe control response channel (--control-response), on stream 1163020033, to this tool alone
Loses nothingthe subscription asks for tether=true, and reliable=true on UDP, unless --control-response already says otherwise
Ids shownthe recording’s stream and session, not the replay’s
On an aeron:ipc or fixed-port channelthe tool picks the replay’s session id (replacing any session-id given) and subscribes to it before asking, so it joins no other publication on that channel and stream and cannot hold one back
On a UDP channel with port 0the tool’s driver picks a port of its own, and the replay is asked for there
A slow readerslows the replay, which loses nothing (a live stream’s tap drops instead)
Its endthe archive ends it: at the length asked, when the recording stops, or when the tool’s subscription closes. The tool sends no stop request

A control-mode=response channel is not supported for a replay. A remote archive needs --control-response with an address it can reach, as the listings do.

Recording lag

Each active recording has a recording position counter in the driver the archive records through. recording-lag reads those counters with the stream’s own position on the same driver (its publisher’s position, or for a stream received from another host its receiver’s high-water mark), so it needs no archive session at all:

             archive             recording       stream      session      counter              recorded            source pos  lag
                  42                     7         3001           88           71               1277952               1310720  32768

lag is the stream’s position minus the recording’s, never below 0; - when this driver neither publishes nor receives the stream. The Recordings tab shows the same as its rec pos and lag columns when the attached driver is the archive’s. Two archives recording through one driver can each have a recording 3, so the counter’s label names its archive, and the tab and recording ID match on the archive and the recording together.

The recording is matched to its stream by the channel in the counter’s label (rec-pos: <recording id> <session id> <stream id> <channel> - archiveId=<n>), not by the session id and the stream id alone: two publications can share those on different channels, and each recording keeps its own numbers. A long channel is cut short by the counter’s label buffer, so a label that names the start of one is matched on that; when it could name more than one of the driver’s streams, the lag is - and the recording’s detail says why.

Offline: the archive directory

archive-dir with no action prints the catalogue header, the mark file and every entry:

field               value
catalogue           fixture/archive.catalog
catalogue version   3.1.0
catalogue capacity  65536
next recording id   3
mark file           fixture/archive-mark.dat
archive version     3.1.0
pid                 82185
archive id          42
started (UTC)       2026-11-30 23:55:04.908
activity (UTC)      -
control              stream 10
local control       aeron:ipc?term-length=64k stream 10
events               stream 30
aeron dir           aeron

           recording  state            stream      session             start pos              stop pos                 bytes  started (UTC)            stopped (UTC)            source                    channel
                   0  VALID              1001   1411926094                     0                   352                   352  2026-11-30 23:55:05.466  2026-11-30 23:55:05.490  aeron:ipc                 aeron:ipc
                   1  INVALID            1002   1411926095                     0                  3104                  3104  2026-11-30 23:55:05.507  2026-11-30 23:55:05.538  aeron:ipc                 aeron:ipc
                   2  VALID              1003   1411926096                     0                     0                     0  2026-11-30 23:55:05.568  2026-11-30 23:55:05.588  aeron:ipc                 aeron:ipc

The actions are ArchiveTool’s read commands:

archive-dir ...ArchiveToolPrints
describe [ID]describe [ID]the VALID entries, or entry ID in any state
describe-alldescribe-allevery entry with its state
count-entriescount-entrieshow many entries are VALID
capacitythe capacity line of describethe catalogue’s length in bytes
pidpidthe archive’s pid, from its mark file
errorserrorsthe archive’s own error log (ergo-aeron errors --aeron-dir reads the driver’s)
dump [--limit N] [--dump BYTES]dump [N]each entry, then each VALID recording’s frames from its segment files
verify [ID] [-a]verify [ID] [-a]the same checks, reporting only
segmentseach segment file, its length and the bytes allocated to it
disk [--between MS]disk use and time until full (below)

--format json prints one object per entry or frame. dump prints frames as they are read; payloads are hex, cut at --dump bytes (65536 by default):

           recording  state            stream      session             start pos              stop pos                 bytes  started (UTC)            stopped (UTC)            source                    channel
                   0  VALID              1001   1411926094                     0                   352                   352  2026-11-30 23:55:05.466  2026-11-30 23:55:05.490  aeron:ipc                 aeron:ipc
            position  frame length  kind                  term offset      term id      session       stream              reserved  payload (hex)
                   0            43  DATA                            0    697683711   1411926094         1001                     0  6d65737361676520303a20
                  64            50  DATA                           64    697683711   1411926094         1001                     0  6d65737361676520313a207878787878 .. (18 bytes)

           recording  state            stream      session             start pos              stop pos                 bytes  started (UTC)            stopped (UTC)            source                    channel
                   1  INVALID            1002   1411926095                     0                  3104                  3104  2026-11-30 23:55:05.507  2026-11-30 23:55:05.538  aeron:ipc                 aeron:ipc
(recordingId=1) skipping data: INVALID

           recording  state            stream      session             start pos              stop pos                 bytes  started (UTC)            stopped (UTC)            source                    channel
                   2  VALID              1003   1411926096                     0                     0                     0  2026-11-30 23:55:05.568  2026-11-30 23:55:05.588  aeron:ipc                 aeron:ipc
(recordingId=2) Recording is empty

Java’s reader stops at an empty frame without a word. When that is before the recording’s stop position, dump says where the data ends and exits 2.

verify runs the checks ArchiveTool verify runs (positions aligned and in order, the last segment file’s frames, every segment file’s with -a) and prints its lines, but marks no entry and truncates no file. Where Java’s verify would change something, the line says so; exit status 1 when an entry would be marked INVALID:

(recordingId=0) OK
(recordingId=1) OK (INVALID in the catalogue: Java's verify would mark it VALID)
(recordingId=2) OK

A last fragment that straddles a page boundary with no data after it is not an error: Java asks whether to truncate the file and prints OK either way, so the line is OK with a note. A segment file that was skipped (a link, a FIFO, a name Aeron does not write) is named on standard error.

verify -checksum is not offered: it needs a Java checksum class.

Differences from ArchiveTool, on purpose

ArchiveToolergo-aeron archive-dir
Openingmaps the catalogue (describe ID read-write), the mark file and segment filesopens each file read-only with no-follow and non-blocking flags and reads by offset; a symbolic link, FIFO or directory named like an archive file is refused (segment files: skipped with a note)
A damaged filean exception, or a SIGBUS on a file that shrankone line naming the file and the length that does not fit, exit status 2; output up to it stands
errorsthe archive’s log, then the driver’s at the mark file’s aeronDirectorythe archive’s log only: that path is read from the file, so it is not followed
verifymarks entries INVALID or VALID, rewrites stop positions, asks to truncate a torn last fragmentchanges nothing and says what Java would change
Mark file linkfollows archive-mark.lnkfollows it too, and says so in the mark file row

The directory named on the command line may itself be a symbolic link (an operator’s own argument, as Kubernetes mounts often are); the files in it are read only where they are.

Disk use and time until full

archive-dir disk reads the directory twice, --between milliseconds apart (1000 by default), and prints one row for the volume (free bytes, size, bytes allocated to segment files, their growth per second, free bytes over that growth as the time until full), one per stream and one per recording. Bytes on disk are the blocks allocated: Aeron sets each segment file to its full length up front, and the file system allocates it as it is written. The Archive dir tab’s status line shows the same for the volume on each read. A preview of what a purge, truncate or detach would free comes with writer mode.

The offline source needs only the archive’s volume, and works on it mounted read-only: the tests run every archive-dir command on a copy whose files are mode 0444 in a directory of mode 0555, and check that no byte and no modification time changed.