Repository navigation
fix(executor): reconcile's DuckDB takes a third of the class limit, leaving its Rust heap room at 10M (#558) - #1508
Merged
Merged
Conversation
…eaving its Rust heap room at 10M (#558) #558's 10M run passed standardize and match on class L (26Gi / 18GB) and then reconcile was OOMKilled 53 s in (exit 137). That's the container limit, not DuckDB's. Reconcile builds its clusters in Rust: every record key twice, the edges, the clusters and one lifecycle event per record. At 10M that heap plus a DuckDB buffer pool allowed 18GB overran 26Gi. open_order_session now asks duckdb_memory_for(task_id, class_limit). SQL stages keep the class limit. reconcile gets a third (18GB becomes 6000MB), stepping down a unit so the split stays exact. A shape the parser doesn't understand keeps the class limit rather than guessing. Unit test reconcile_leaves_the_heap_room_and_sql_stages_keep_the_class_limit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 30, 2026 12:14 — with
GitHub Actions
Inactive
7 tasks
athvin
added a commit
that referenced
this pull request
Nov 30, 2026
…ders, not a million-tuple VALUES literal (#558) (#1511) After #1508 capped reconcile's DuckDB at a third of the class limit, the 10M run's reconcile was still OOMKilled at class L's 26Gi, 53 s in. Measured locally in release with the #558 corpus and model: 1M records: reconcile 45.7 s, peak RSS 8.3 GB (231k scores, so the edges don't explain it) The cause: reconcile wrote membership as one 'create temp table __mem_src as select * from (values (…), (…), …)' with a tuple per assigned record, and the entity transitions the same way (__ent_src). DuckDB parsed a million-tuple literal, a parse tree of several KB per row, so at 10M about 80 GB. Both are now created with a schema and filled through a DuckDB appender, as #1409 did for events. The declared upsert_from_src statements are unchanged. Measured after: 1M records: reconcile 5.1 s, peak RSS 3.26 GB 2M records: reconcile 12.6 s, peak RSS 4.73 GB That's about 1.5 GB per million plus 1.8 GB, so about 16.5 GB at 10M, inside class L's 26Gi with reconcile's DuckDB at 6 GB (#1508). 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 #558
What
open_order_sessionsizes DuckDB per task: SQL stages keep the class limit, andreconcilegets a third of it (18GB becomes 6000MB).Why
#558's 10M run passed standardize (#1504) and match, then reconcile was OOMKilled 53 s in (exit 137): the container limit, not DuckDB's. Reconcile builds its clusters in Rust, and that heap plus an 18GB DuckDB buffer pool overran 26Gi.
Proof
Unit test
reconcile_leaves_the_heap_room_and_sql_stages_keep_the_class_limit.make checkexit 0. The live proof is the 10M rerun from reconcile onward on this build, recorded in this ledger.Risk & rollback
Only reconcile's DuckDB budget changes, and reconcile's SQL is small. Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: unclosed
mainis 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:
imagesbuilt, or correctly never ran because nothing that goes intoan image changed:
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion:
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change:
Donethrough the automation rather than byhand, and the issue closed:
(a skill, a reference, memory) — or nothing new was learned:
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
🤖 Generated with Claude Code