Skip to content

The network intakes stat the manifest instead of parsing it every second - #198

Merged
torstei merged 1 commit into
mainfrom
bugfix/intake-tick-stat
Oct 3, 2026
Merged

torstei merged 1 commit into
mainfrom
bugfix/intake-tick-stat

Conversation

@torstei

@torstei torstei commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Follow-up to #192, which did this for the records sink. The tick shared by the OTLP, Forward and incus intakes still read and parsed every open store's .bark several times a second to look for a retention or wal change (declared_retention, subject_of, and the wal declaration for all stores under one lock).

Change

Each store gets a LivePolicy, as the appender and the sink already have: the manifest is re-read only when its (mtime, len) changed, and the wal declaration is applied to that store when it did. Intake::sync_wal_declaration(name) replaces the walk over every store.

Measured

forward-intake with one store open and retention declared, steady state (strace):

.bark opens .bark stats
before 4.2 /s 0
after 0.2 /s 1 /s

I did not trace the residual opens. A live set wal=false on an open store prints the identical note on both binaries.

Behaviour change

A manifest that stops parsing keeps the last good policy with one warning, as it does for the appender and the sink, where this tick used to skip enforcement silently.

Test

sync_wal_declaration applies to the store named and to no other (an intake store starts with a write-ahead segment, so the test declares wal=false on two and syncs one). Making it sync every store, as the old code did, fails it.

Not here

index_declared is still read when a store's chunk count changes (about once per flush). It's per flush, not per tick, so I left it.

🤖 Generated with Claude Code

The tick shared by the OTLP, Forward and incus intakes read and parsed every
open store's .bark several times a second to look for a retention or wal
change: declared_retention, subject_of, and the wal declaration for all
stores under one lock.

Each store now has a LivePolicy, as the appender and the records sink do: the
manifest is re-read only when its (mtime, len) changed, and the wal
declaration is applied to that one store when it did. The per-store entry
point replaces the walk over every store. A manifest that stops parsing keeps
the last good policy with a warning, where the tick used to skip enforcement
silently.

Forward intake with a store open, steady state: 4.2 .bark opens a second
before, 0.2 after plus one stat.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@torstei
torstei merged commit 183841b into main Oct 3, 2026
7 checks passed
@torstei
torstei deleted the bugfix/intake-tick-stat branch October 3, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant