Repository navigation
fix(ingest): write raw_records in 500-row slices, so standardize fits in memory at 10M (#1494) - #1496
Merged
Merged
Conversation
… in memory at 10M (#1494) #1475 staged a delivery and wrote it in one INSERT … SELECT, so one Parquet file. #558's 10M run then failed in standardize: Out of Memory, 7.4/7.4 GiB at class L, three minutes in. With the old layout (500-row files) standardize had passed at 10M in 7.4 minutes. Bisected locally at 2M rows with a 1.5 GB limit: - one file OOMs at 4 and 12 threads and passes at 1 and 2, so the cost is per-thread scan state; - small Parquet row groups inside one file (2048, 4096, 16384) still OOM, as do 2,000- and 20,000-row files; - disabling parquet prefetching or the metadata cache doesn't help; - 500-row files pass at 12 threads, twice; - moving the current-version window before the transforms didn't help, so it isn't part of this change. The staged appender stays. append_from_src now takes a seq range, and landing writes the staged rows in RAW_FILE_ROWS (500) slices, one short statement each. The old path's cost was 5,500 bound parameters per statement, not the count. Measured (debug build, 2M rows): ingest 111.7 s against 106 s for one file, 4,000 files, and standardize passes at 1.5 GB / 12 threads in 165.5 s. The large-delivery test (1,201 rows, three slices) still asserts CSV order. The rollback and golden tests pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 30, 2026 08:22 — with
GitHub Actions
Inactive
athvin
added a commit
that referenced
this pull request
Nov 30, 2026
…ndardize needs more than 8GB of DuckDB (#558) (#1501) #558's 10M run on er-dev, with a realistic-cardinality corpus, failed standardize with Out of Memory (7.4/7.4 GiB) at class L's 14Gi / 8GB: - on #1475's single-file layout, after 3 minutes; - on #1496's 500-row files, after 4.5 minutes, at 13.2 of 14 GiB. The old layout's earlier pass at 10M was on a low-cardinality corpus. Every runner-l shape has at least 32 GiB (c5ad, c6id or c8id.4xlarge; m6id has 64), and L used 14 of it. L is now 26Gi with DuckDB at 18GB, which keeps DuckDB strictly below the container (the D-SIZING invariant) and leaves room for the node's daemonsets. That means one L pod per node. The dev namespace already admits at most two L pods, since ephemeral storage refuses a third: 2 x 26Gi + app = 57Gi of the 80Gi quota. helm template renders ER_DUCKDB_MEMORY_LIMIT=18GB with 26Gi requests and limits. infrastructure.md §6.5, batch-orchestration-design and the quota comment are updated. Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was previously deployed
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.
Closes #1494
What
Ingest keeps #1475's single staged appender, but writes raw_records in 500-row
seqslices (append_from_srcnow takes a range), one Parquet file each, not one file for the whole delivery.Why
#558's 10M run failed in standardize: Out of Memory, 7.4/7.4 GiB at class L. With one large raw_records file, standardize's per-thread scan state outgrows the limit. The old 500-row-file layout passed at 10M.
Proof
Bisected locally at 2M rows with a 1.5 GB limit:
With this change, on the real code path: ingest 111.7 s (106 s as one file), 4,000 files, standardize passes in 165.5 s. The large-delivery test (1,201 rows, three slices) asserts CSV order.
make checkexit 0.Risk & rollback
Ingest issues one short statement per 500 rows, inside the same lake transaction, so a failure still lands nothing. Rollback:
git revert <merge-sha>(10M standardize OOMs again).Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onMac· 2026-11-30T08:34:29Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not: — 0633718, rust 46381089863 + frontend 46381089827 success
imagesbuilt, or correctly never ran because nothing that goes intoan image changed: — success, run 46381089925
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: — run 46381683817 success (0633718); 10M-scale spill run without eviction #558's 10M rerun on this build is the live proof, recorded below once it reaches match
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: — infra success on 0633718
Donethrough the automation rather than byhand, and the issue closed: — fix(standardize): picking each record's current version after every transform OOMs at 10M — the window buffers all ~25 standardized columns #1494 CLOSED by fix(ingest): write raw_records in 500-row slices, so standardize fits in memory at 10M (#1494) #1496 via automation
(a skill, a reference, memory) — or nothing new was learned: — DuckDB's per-thread scan state over one large Parquet file outgrew the limit where 500-row files did not; small row groups inside one file did not help, so bound the files
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
Details of the bisect are on #1494.
🤖 Generated with Claude Code