The auditor

The auditor

Run and size the background process that reorganizes stored records and reclaims storage.

The auditor is the background process that keeps storage tidy. It copies each stream's records out of the shared write objects into objects of its own, deletes what trim, retention, and stream deletion leave behind, and finishes the work a stopped node left open. It runs inside every novad by default. Appends never wait for it, so a slow auditor costs storage, not latency: shared write objects and their metadata rows pile up until it catches up.

The quickest view of its work is its queues, here through the admin bridge on a node:

curl -s localhost:9191/admin/api/ListAuditQueues -d '{}'
{
  "queues": [
    {
      "jobType": "retention",
      "depth": "2",
      "oldestReadyAtUnixMs": "1795378383538"
    },
    {
      "jobType": "denorm",
      "depth": "2"
    },
    {
      "jobType": "teardown",
      "depth": "1",
      "oldestReadyAtUnixMs": "1795375120737"
    }
  ]
}

Empty queues are left out here. The list covers seven of the auditor's queues, and counts each one's depth up to 1,000 (depthCapped says when it stopped). denorm, gc, and orphan show no oldest time, because their keys carry no ready time.

A job waits in its queue until its ready time, so depth alone is normal. What matters is how far past due the oldest job is: nova_auditor_due_age_seconds{queue}. It also covers recovery, trimcheck, star-reclaim, and range-split, which the list leaves out. Auditor delays says what each queue's age means.

What it does

The auditor registers 14 duties, each with its own queue. In plain terms:

WorkDutiesWhy it matters
Copy records into per-stream objectsdenormLets the shared write objects be deleted; must keep up with ingest
Delete copied write objectstrimcheckFrees the WAL's storage
Apply trim and retentionretention, retention-checkMakes old records unreadable, then reclaimable
Delete objects nothing referencesreap, gc, orphanFrees storage and catches objects a crash left behind
Delete streamsteardown, teardown-finalRemoves a deleted stream's records and metadata
Finish a stopped node's writesrecoveryIndexes records a node acknowledged before it stopped
Clean up a retired nodestar-reclaimDeletes a decommissioned node's ledger records and leftover objects
Scalable streamsrange-intent, range-split, range-mergeFinishes range changes

Duties explains each one, and Stream objects and denorm the copy.

Where it runs

ModeFlagWhat runsUse when
Beside serving--audit=on (default)Every node runs an auditor with its own metadata and storage clientsSmall and medium clusters
Serving only--audit=offThe node serves and takes no background workServing nodes in a split deployment
Auditor only--audit=onlyBackground work only: the process does not register as a serving node or lead streamsA dedicated pool, when background I/O competes with appends

Auditors share work through a ring in the metadata store, so they need no stable identity and you can add or remove them freely. An --audit=only process is ready once its ring announcement is live. It refuses to start over object storage without --auditor-fetch-cache-dir.

Split the work when the auditor's downloads and uploads compete with appends for network: run the serving nodes with --audit=off and a pool with --audit=only. On Docker Compose:

Run the Compose stack with a separate auditor
NOVA_AUDIT=off docker compose --profile audit-split \
  -f deploy/docker/docker-compose.yml up -d --build

On Kubernetes, the controller runs the pool from the cluster resource's audit section; see Size the pool on Kubernetes.

Size and tune it

Denorm is the work that must keep up: it moves every byte written, once. Size the auditor's bandwidth and request budgets for the sustained write rate, with margin, then watch nova_auditor_due_age_seconds{queue="denorm"}. Everything else is small beside it.

Budgets

Four rate limits pace the auditor's storage work. Each allows a burst of one second's budget.

FlagDefaultMetersScope
--auditor-s3-budget50 req/sProbe reads, writes, deletes, and direct source readsPer auditor process
--auditor-rewrite-mib64 MiB/sBytes downloaded or uploaded through the process; server-side copies of chunks of 5 MiB or more do not countPer auditor process
--auditor-delete-budget1,000 keys/s per bucketEvery key deleted; a batch delete counts each keyShared by all auditors
--auditor-read-budget10,000 req/s per bucketEvery GET, LIST, and copy part, paid before it is sentShared by all auditors

For the two shared budgets, each auditor takes an equal share. It starts at a tenth of its share, and halves its rate and pauses each time S3 throttles it or the object cache refuses it. --auditor-read-concurrency (64) caps the reads one auditor holds open.

To see which budget holds the auditor back, read nova_auditor_budget_wait_seconds by resource: requests for the request budget, rewrite_bytes for the bandwidth budget. The Auditor dashboard charts it beside the delete- and read-budget rates and throttles.

Denorm books a group's whole cost on the request and bandwidth budgets before it moves a byte. When the wait would outlast the job's time, the group shrinks, or the job pauses: it keeps the work it committed, and its marker stays for the next job. nova_auditor_denorm_budget_holds_total counts these by outcome. A climbing paused count means the budgets set how fast denorm drains: raise --auditor-rewrite-mib and --auditor-s3-budget, or add auditors. A climbing dropped count means groups no longer fit into a stream's last object and are written as objects of their own, so small objects pile up; no records are lost. Denorm also keeps its per-record state within --auditor-denorm-memory-mib: a quarter of the container's memory limit by default, or 512 MiB when there is none. A steady nova_auditor_denorm_memory_waits_total means that budget, not the work, paces denorm. Stream objects and denorm explains the booking.

Writes come first. When S3 throttles a node's WAL write, the node reports storage pressure for that storage class for 30 seconds. While any node reports it, and for a minute after, every auditor pauses that class's deletes. Denorm continues. nova_auditor_deletes_suspended shows which buckets are paused.

Workers

FlagDefaultEffect
--auditor-workers2Concurrent jobs per process; one duty holds at most half of them, at least one
--auditor-markers-per-era1Ready denorm markers of one ledger gathered into one job
--auditor-member-parallel8Streams copied at once inside one denorm job

More workers help when jobs wait on metadata latency and the budgets have room. Once a budget is used up, more workers add memory and lease traffic, not throughput.

The fetch cache

A write object holds many streams. Without a cache, denorm reads it once per stream, by range. The fetch cache downloads each object whole to local scratch, once, and every stream in it reads from there. Run auditors with it.

FlagDefaultNotes
--auditor-fetch-cache-diroffTurns the cache on. Start wipes the directory, so point it at dedicated scratch, never at data.
--auditor-fetch-cache-mib40960Scratch the cache may use; a read that does not fit uses a ranged GET. Below twice the workers times 64 MiB, the node refuses to start.
--auditor-fetch-parallel64Downloads at once, warming the next objects

Cached files are disposable. Downloads count against the request and bandwidth budgets.

A node that runs an auditor beside serving over object storage, without the cache, logs a warning at start: novad: the auditor has no fetch cache: denorm reads every slice of every WAL object with its own GET and falls behind ingest past a few MiB/s; give it --auditor-fetch-cache-dir.

Grace periods and timers

FlagDefaultRule
--auditor-read-grace10mWait between an object's last reference going and its delete. Keep it above twice any reader's cached-footer lifetime. A read plan, the list of objects a node gives the Gateway to read directly, lasts half of it.
--auditor-orphan-grace1hAge at which an unresolved write intent is judged; keep it above the slowest valid publish
--denorm-linger5mWait after a stream crosses 8 MiB before its records are copied
--denorm-age-cap24hLongest a Standard record stays in a shared write object
--express-denorm-age-cap1hThe same for Express, whose storage costs more
--denorm-output-cap-mib256Largest object denorm writes

A shorter read grace frees storage sooner but gives the Gateway's direct reads less time. The Compose stack uses 2m, so its read plans last 1m. Busy streams are normally copied at the linger; the age cap catches quiet ones. If busy streams keep reaching the age cap, denorm is behind.

Raise capacity gradually

The auditor and the serving nodes share the metadata store, and the auditor's metadata calls have no separate limit. A burst of background work that becomes due together can raise metadata write latency enough to delay the indexer, and then appends wait. Raise workers, budgets, and --auditor-markers-per-era one step at a time, watching metadata write p99, nova_wal_backlog_stall_total, and the due ages.

Size the pool on Kubernetes

The controller renders the auditor pool from the cluster resource's audit section:

FieldDefaultMeaning
replicasnonePool size; scaling down is an ordinary delete
s3Budget, rewriteMiBthe node defaultsPer-auditor request and bandwidth budgets
slice.scratch300GiFetch-cache disk; the cache uses 90% of it. Under 50Gi, zero included, no auditor is rendered and AuditScratchTooSmall says why.
autoscale.min, autoscale.maxnoneBounds for the sizing loop
autoscale.ageThreshold5mDue age past which cleanup counts as behind
autoscale.busyPercent50With overdue work, utilization at or above it adds an auditor; below it, scaling pauses and reports AuditWedged
autoscale.lowWaterPercent, autoscale.scaleDownAfter30, 30mHealthy queues and low utilization this long remove an auditor

The reference slice is 3.5 Gbps of network, 4 CPUs, 8Gi of memory requested and 12Gi as the limit, and 300Gi of scratch. Size scratch to about the ingest times the linger, shared across the pool. For bandwidth, count each write object downloaded once plus each output uploaded, and set rewriteMiB times replicas above that with margin.

If it goes wrong

SymptomLikely causeWhat to do
NovaAuditorsAbsent fires: no nova_auditor_due_age_seconds series at allNo auditor runs: every node has --audit=off, or the pool has no running podStart an --audit=only pool. On Kubernetes, check the pool's pods and the AuditScratchTooSmall condition
AuditScratchTooSmall on the cluster resource, and no auditor podsslice.scratch is under 50GiRaise it; the controller renders the pool again
The node exits at start, naming --auditor-fetch-cache-dirAn auditor-only process over object storage without the fetch cacheSet --auditor-fetch-cache-dir to dedicated scratch
The node exits at start, naming --auditor-fetch-cache-mibThe cache is smaller than twice the workers times 64 MiBRaise --auditor-fetch-cache-mib to the number the error names, or lower --auditor-workers
nova_auditor_due_age_seconds{queue="denorm"} climbsDenorm is slower than ingest, or one ledger is stuckFollow Denorm falls behind
Metadata write p99 and nova_wal_backlog_stall_total rise after you raised auditor capacityBackground work competes with the indexer for the metadata storeStep workers or budgets back; see Raise capacity gradually

The two start errors read:

novad: invalid configuration: --audit=only over object storage needs --auditor-fetch-cache-dir: without a fetch cache, denorm reads every slice of every WAL object with its own GET and falls far behind ingest
novad: invalid configuration: --auditor-fetch-cache-mib: 100 MiB leaves each of 2 workers' denorm walks under 64 MiB of read-ahead; give it at least 256

See also

On this page