Repository navigation
fix(ingest): exact WAL backlog and org queue counters, no metering for refused batches - #2440
Conversation
…ing refused batches - WAL backlog no longer drifts up. A sync counted every frame in its batch as committed, including frames whose caller had been dropped (request timeout, client disconnect). Those are never delivered to export, so they were never marked exported and the backlog never returned to 0: every shutdown waited the full drain window and scale-in protection could stick. A skipped delivery now takes its bytes back out of the lane's committed count. - A failed cursor write no longer leaks org queue bytes. The batch leaves memory either way, so the org's bytes are released before the error is returned. The comment that claimed the batch "will be replayed" is corrected. - A collector 4xx relayed in forward mode is no longer metered or billed, on both the HTTP and gRPC paths (it already did not count as key use on HTTP). - read_wal_frame no longer allocates the header's payload length (up to 4 GiB) before the checksum: the buffer grows with the bytes actually read, and a short read is a corrupt frame. - INGEST_QUEUE_CHANNEL_CAPACITY=0 is refused at validation instead of panicking in mpsc::channel(0) at boot. - Remove INGEST_TINYBIRD_CONCURRENCY_PER_SHARD: it was parsed, validated and forwarded but nothing read it (there is one export worker per lane). - Remove accept_rows, which had no callers. - Comments: the WAL lives on the EC2 instance store, not Fargate ephemeral storage, and the prebuilt image compiles in rust:1.94-bookworm.
…ps like the gateway - An unknown severity number is now the empty string, not its decimal form, matching the gateway's and Maple Local's encoders. - A timestamp above the int64 maximum is written as the epoch. It used to wrap negative, and a value outside DateTime64(9) fails the whole insert. - Drop the leftover unused-import guard in exporter_traces.go. - README: org_id is stamped on every record; a resource attribute overrides it only when org_id_from_resource_attribute is set, as config.go documents.
This comment has been minimized.
This comment has been minimized.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…tored the batch In dual mode the batch is accepted into the WAL before it is forwarded, so a collector refusal does not mean nothing was stored. Only a refusal that left nothing behind skips metering and key use, on the HTTP and the gRPC path.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
… use Only the HTTP path of the metering skip was pinned.
|
On the latest review (
Both are uncompiled until the Ingest Rust tests job runs on this head. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Maple review🟢 Confidence 10/10 · safe to merge. Backlog and org-byte arithmetic verified by reading the lane sync/delivery ordering; the Rust test job has not finished at this head. Fixes five WAL/metering defects in the ingest gateway plus two encoder mismatches in the Go collector exporter, and drops the unused
Before merge
|
|
Merged with 3 steps from "Before merge" still open. If they are done, tick them on the review comment; if not, now is the time.
|
Stacked on #2439. Part of the audit stack that starts at #2434.
The Rust in this PR was written without compiling it locally. The
Ingest Rust testsjob on this PR built it and its tests pass. The Go changes were built and tested locally.Bugs fixed
mark_exportedfailed, the frames left memory but the org's queue counter kept their bytes until restart, throttling the org on a queue that no longer existed. The bytes are now released before the error is returned.INGEST_QUEUE_CHANNEL_CAPACITY=0panicked at boot. It is rejected in config validation."0"instead of"", and a timestamp above the int64 range wrapped instead of mapping to the epoch.Removed
INGEST_TINYBIRD_CONCURRENCY_PER_SHARD: parsed, validated and forwarded, but nothing read it. There is one export worker per lane.accept_rows: no callers.Stale "Fargate ephemeral storage" comments and a Rust version in
Dockerfile.prebuiltare corrected.Verification
go vet ./...andgo test ./...pass. The new cases fail against the oldencoding.go.Ingest Rust testsand Rust code scanning jobs pass. New tests cover the backlog counter, the cursor-write failure, the oversized frame header, the zero channel capacity, the refused relay over HTTP and gRPC, and the dual-mode rule.Left for a decision
INGEST_TINYBIRD_CONCURRENCY_PER_SHARDcan be dropped from the prd and dev deploy configs; the gateway ignores it.