Repository navigation
perf(resolve): a lake-free session for DuckDB-file catalogs, reading the data files directly (#1497) - #1500
Merged
Conversation
…the data files directly (#1497) er-dev's p3live keeps its catalog as a DuckDB file on EFS, so #1482's cached session never applied: every call attached the lake (~700 ms) and scanned the 259 MB corpus (~390 ms). A DuckDB-file catalog cannot be held between requests; the handle would lock out the runner pods' writes. - er_cli::detach_corpus lists, from an attached lake, the standardized corpus's and the membership's data files as read_parquet sources, plus the snapshot. It returns None, and the caller resolves through the lake, when a relation has delete files, has rows inlined in the catalog (the files' count differs from the table's), or is missing. ResolveCache::set_detached makes resolve_record_cached read those sources: corpus, prefilter key cache keyed by the change stamp, membership join, and snapshot. - er-server: a file-catalog dataset keeps an in-memory session and cache per env. The stamp is the mtime and size of the catalog file and its .wal. The lake is opened only when the stamp changes, to re-list the files, and then closed. Each call runs without a lake handle and reads only the candidates' rows. A failed resolve drops the session. a_detached_resolve_matches_the_lake_resolve: on base_10, a detached resolve equals the lake resolve (decision, candidates, probabilities, entity ids, snapshot), twice over the cached session. pg_launch_proof, whose lake is a local DuckDB file, passes on the detached path, including the run that writes the lake between resolves. er-cli resolve tests pass (8). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The freeform_sql gate allows no free-form lake reads outside dedupe-core. The catalog file listing and the row-count check behind detach_corpus are DuckLake mechanics, like lake_table_exists, so they move to Session::lake_data_files. er-cli only builds the read_parquet source from its answer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 30, 2026 08:42 — with
GitHub Actions
Inactive
athvin
added a commit
that referenced
this pull request
Nov 30, 2026
… cache a refused detach (#1502) (#1503) On er-dev bbf4e4a the lake-free path never ran (persistent=false on 61/61), and wall time rose about 500 ms. p3live's entity_membership has delete files or inlined rows, so detach_corpus refused. Nothing cached the refusal, so every call opened the lake twice: the failed detach, then the fallback. - The serving in-memory session refreshes itself. er_cli::attach_lake attaches the catalog, detach_corpus lists the corpus's data files and copies entity_membership into the session temp table __resolve_membership through the catalog (Session::copy_lake_table), so deletes and inlined rows apply exactly. Then Session::detach_lake releases the lock, whatever the refresh did. Only the corpus must be plain data files. - A refusal returns its reason. The server logs it once and records it per change stamp (ResolveCache::refuse), so a fallback dataset opens the lake once per call, as before #1500, and no detach is retried until the catalog changes. a_detached_resolve_matches_the_lake_resolve now refreshes the serving session itself (attach, detach_corpus, detach_lake) after the lake session releases the file catalog, and still equals the lake resolve. pg_launch_proof (local DuckDB-file lake, with a run writing it between resolves) passes. Resolve tests (8) and the freeform_sql gate pass. 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 #1497
Part of #1429. #1429 stays open until er-dev measures p95 under 300 ms.
What
Session::lake_data_files(dedupe-core): a relation's data files, only when they alone reproduce it: no delete files, and the file rows equal the table's, so nothing is inlined in the catalog.er_cli::detach_corpusandResolveCache::set_detached: resolve reads the standardized corpus and the membership asread_parquetover those files. The prefilter key cache is keyed by a change stamp, and the snapshot is the one the files were listed at..wal.Why
On er-dev, p3live's
ER_LAKE_CATALOGis a DuckDB file on EFS, so #1482's Postgres-only session never applied: 61/61 calls loggedpersistent=false.Per call (from
e1b7ef0d'sresolve timings):A file catalog can't be held between requests: its handle would lock out the runner pods' writes.
Proof
a_detached_resolve_matches_the_lake_resolve(base_10): the detached resolve equals the lake resolve (decision, candidates, probabilities, entity ids, snapshot), twice over the cached session.pg_launch_proof, whose lake is a local DuckDB file, passes on the detached path, including a run that writes the lake between resolves, so the writer isn't locked out.freeform_sqlgate passes.make check: exit 0.Risk & rollback
git revert <merge-sha>, which restores per-call lake attach.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
persistent=truein theresolve timingsevents:🤖 Generated with Claude Code