Repository navigation
fix(resolve): copy the membership through the catalog on refresh, and cache a refused detach (#1502) - #1503
Merged
Conversation
… cache a refused detach (#1502) 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: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 30, 2026 10:03 — with
GitHub Actions
Inactive
This was referenced Nov 30, 2026
Merged
Closed
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 #1502
Part of #1429. #1429 stays open until er-dev measures p95 under 300 ms.
What
er_cli::attach_lakeattaches the catalog.detach_corpuslists the corpus's data files and copiesentity_membershipinto the session temp table__resolve_membershipthrough the catalog (Session::copy_lake_table), so delete files and inlined rows apply exactly.Session::detach_lakethen releases the file lock, whatever the refresh did.resolve reads this dataset through the lake) and records it per change stamp (ResolveCache::refuse). A fallback dataset then opens the lake once per call, and no detach is retried until the catalog changes.Why
On er-dev
bbf4e4a6(#1500), the lake-free path never ran:persistent=falseon 61/61 calls, and wall time was about 500 ms worse (p50 2176 / p95 2535 ms).detach_corpusrefused p3live, most likely because itsentity_membershipcarries delete files or inlined rows from many incremental runs.Proof
a_detached_resolve_matches_the_lake_resolve: the serving session refreshes itself (attach,detach_corpus,detach_lake) after the lake session releases the file catalog, and its answers equal the lake resolve (decision, candidates, probabilities, entity ids, snapshot), twice.pg_launch_proof(local DuckDB-file lake, a run writing it between resolves) passes.freeform_sqlgate pass.make check: exit 0.Risk & 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
persistent=true(or the logged refusal reason):🤖 Generated with Claude Code