Repository navigation
🐛 fix(export): stop silent oversize drops and torn relational snapshots (K-01/K-02/K-03/K-31) - #378
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
konih
force-pushed
the
fm/kollect-b1-export
branch
from
October 1, 2026 15:35
1fef40c to
534dd10
Compare
K-01: a non-object-store sink asked to deliver an envelope above the 1 MiB
inline cap returned success while writing nothing, so the controller recorded
Exported/Ready and suppressed re-export. RunExportEnvelope now returns a
terminal ErrSpillRequired, mapped to Degraded/SpillRequired and the
kollect_sink_errors_total{reason="spill_required"} label; the coalesce checksum
is not recorded on failure.
K-02: PartitionEnvelopes ran for every family, so database/event sinks got
parts whose diff-delete/stream erased each other. Multipart now applies only to
snapshot-family bindings; database and event sinks receive one complete payload.
Their per-binding maxExportBytes becomes a soft bound, surfaced by an
ExportCeilingExceeded Warning event.
K-03: docs describe the inline cap and the loud skip instead of an object-store
spill mechanism that does not exist (captain call C-3b).
K-31: the findings register has no K-31 entry (ID appears only in the batch
table; K-27/K-31/K-43 are absent while the report claims 82 findings). The fix
covers both export call sites; the gap is recorded in specs/evidence/K-31.md.
Test lock: internal/controller/export_size_band_test.go covers git-only 1.2 MiB
-> Degraded/SpillRequired, git+postgres mixed (no sink green), and postgres-only
500 KiB ceiling -> all rows survive.
konih
force-pushed
the
fm/kollect-b1-export
branch
from
October 1, 2026 16:00
534dd10 to
c4a810d
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



TL;DR
docs/crds/index.md; see the K-31 note below.Summary
Closes the headline CRITICAL from the six-review unification (
data/kollect-unify/report.md§4/§6), batch B1.RunExportEnvelopereturnednilwhen a non-object-store backend could not take an envelope above the 1 MiB inline cap. The controller recordedExported/Readyand suppressed re-export for up to 24 h: silent data loss with green telemetry. It now returns a terminalsink.ErrSpillRequired, mapped toDegraded/SpillRequiredandkollect_sink_errors_total{reason="spill_required"}; the coalesce checksum is not recorded, so a later reconcile can retry.PartitionEnvelopesran for every binding family. Postgres/Mongo/BigQuery diff-delete per part and event sinks stream per part, so part N erased/shadowed part N-1. Multipart now applies only toSinkFamilySnapshot; database and event sinks get one complete payload. Their per-bindingmaxExportBytesbecomes a soft bound, surfaced by a newExportCeilingExceededWarning event.specs/001-export-correctness/evidence/K-31.md. The register owner should either define or drop K-31.Test lock (end-to-end size band)
internal/controller/export_size_band_test.go:TestExportSizeBand_gitOnlyOversizeDegrades— git-only 1.2 MiB →Degraded/SpillRequired, sink receives nothing, neverExported.TestExportSizeBand_gitPostgresMixedNotSilentlyGreen— mixed binding, no sink reads green.TestExportSizeBand_postgresCeilingKeepsAllRows— postgres-only, 500 KiB per-binding ceiling, ~700 KiB snapshot → exactly one complete payload, all rows survive.Plus
TestRunExportEnvelope_oversizedNonObjectStoreFailsLoudly,..._oversizedObjectStoreExports,TestWarnSoftCeilingExceeded, and thespill_requiredmetric-label assertion.Risk / behaviour change
REQUIREMENTS.md,ADR-0103,ADR-0405,crds/index.md, and operator docs.maxExportBytesat or below 1 MiB so every multipart part stays under the cap; otherwise the oversize part failsSpillRequired.Testing
go test ./internal/sink/ ./internal/export/— passKUBEBUILDER_ASSETS=bin/k8s/1.36.2-darwin-arm64 go test ./internal/controller/— passbin/golangci-lint run ./internal/sink/... ./internal/export/... ./internal/controller/...— 0 issuesScope
Only batch B1 findings are touched. Total-failure per-sink status persistence is deliberately left to B8 (status truth); noted in the test comments.