Repository navigation
Conversation
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.
Drizzle calls postgres.js
unsafe()with preparation disabled, adding a Describe/Flush exchange to parameterized queries. Dialog opening also locked each owner separately and reread unchanged state. Batch owner locks in user-ID order, bind hot owner lists as one array, and skip only proven no-op readbacks. Reset replay rewind backoff after the client passes its previous high-water mark.Keep preparation restricted to the previously tuned replay-access queries by default. Broad preparation is now an explicit
INLINE_DATABASE_PREPARED_QUERIES=all-customopt-in: startup and readiness checkforce_custom_planthrough the query pool. This avoids introducing generic plans for parameter-sensitive queries. The application does not change database roles/settings. Operators must qualify role defaults, recycle existing pooled backends, and measure representative replay before enabling it; one sampled backend cannot prove the whole pool inherited a setting.Cap retained signatures at 200, admit broad shapes only after a second observation, and reserve capacity for access queries by limiting broad signatures to 100. Candidate tracking is bounded. Retained signatures are deliberately not advertised as an LRU; overflow keeps the original unnamed path. Pool/per-call opt-outs and transaction/savepoint behavior remain intact.
Validation: 40 focused prepared/connection/wire tests passed, final guard/readiness integration rerun passed 12; four dialog PostgreSQL tests and five replay guard tests passed. Partial-index tests verify retained index use and zero generic plans after more than five custom executions. Benchmark harness mode/report tests and typecheck passed. Controlled 20-sample handler benchmarks at injected +6 ms show access→all-custom exchanges 43→24 for DM sends, 51→28 for public sends, and 19→11 for history; respective medians 267.54→142.41 ms, 363.07→201.41 ms, and 192.13→101.56 ms. Proxy calibration differs slightly between runs; these are synthetic handler measurements, not production API latency. User-bucket replay qualification is separate; these replay fixtures exercise chat buckets. Full server/image CI passed at
0b51ed38f; latest test-only proxy half-close fix has 11 passing wire/measurement tests and typecheck, with hosted CI pending. Prior5dc49a0f2global-preparation measurements are historical, not evidence for the revised default. No production deploy, role change, migration, DNS or traffic switch.