Repository navigation
POC: one registry return for the Postgres bus - #4605
Closed
cursor[bot] wants to merge 6 commits into
Closed
cursor[bot] wants to merge 6 commits into
cursor[bot] wants to merge 6 commits into
Conversation
…on another
postgresStores backs the bus slot. A notice reaches the writing process's
views at once and goes out as pg_notify('fsd_bus'); one LISTEN connection per
process with an open view, from the tail pool, fans notices out. The bus says
it crosses processes only while it hears its own ping (every 2 s, stale after
3 s), so behind a pooler or after a drop views keep the timed read; it
reconnects without giving up, resyncs, and warns once when the first ping
never comes back. Request tails share the new listen helper.
Engine cleanups promised on #4594: one bus per wrapped store (a second is
refused), one deferral hop and one microtask per publish, and notice-assembly
failures debug-logged instead of swallowed.
Goal check goals/session-stream/wakes-across-processes/ on two forked
processes over a real Postgres, with goals/lib/postgres.mts and peers.mts
shared with the closure goal (FIX-2368).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
Gloss crossesProcesses and link the engine's Change bus section; state the notice's real guarantee (sent only once the write lands); give the silent-drop bound as computed; make the serverless advice agree with the liveTailPool fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
…t opens Codex on #4598. A notice sent after a view's first read and before the process's first LISTEN took effect was heard by nobody, and the first ping then said "crosses" and stopped the view's timed read: the view stayed stale. The bus now sends every subscriber a resync on each connection, the first included, before a ping can say it crosses. openListen could hand back a connection that failed between LISTEN answering and the helper resuming, with no loss callback; a request tail then waited out its liveness timeout instead of reconnecting. The helper now refuses it, as a failed LISTEN is refused, so every caller reconnects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
The connection-string branch returned its own copy of the store list, including the bus. It now joins the return the other shapes already use. Schema init stays on the dedicated client. Co-authored-by: Jake Hoffner <jhoffner@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
jhoffner
pushed a commit
that referenced
this pull request
Nov 3, 2026
…STEN failure; one registry build Codex on #4598 (r4454225127): a notice too large for NOTIFY went out without its resource, and the receiving in-process fan-out gives a narrowed subscriber only an exact resource match, so remote views narrowed to that resource never heard it. A widened payload now carries `w: true`, and the receiver wakes every subscriber of the scope, narrowed or not, each on its own topic. The first failure to open the listening connection now warns once, with the error. createPostgresStores builds its registry once for every shape (Cursor's review, PoC #4605): the connection-string path still initializes on its dedicated client and publishes as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UNkLEJU1iqxFYoPadTRfn
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.
This PR does not merge
A smaller shape of #4598. Fold the subtraction into
fix/FIX-2427-postgres-bus, then close this unmerged.What I subtracted
createPostgresStoresbuilt the registry twice. The connection-string branch returned its own copy, and the bus (notify: true,close()before the pools) was pasted into both. One return now serves every shape. Net −20 lines inpackages/store-postgres/src/index.ts.The connection-string shape still initializes schema on a dedicated client.
schemaInitializedkeeps the shared path from doing it again on the pool.{ pool }and a connection string stillpg_notifywith no tail pool. An{ executor }still does not, unless a tail pool is passed.What still passes
pnpm exec vitest run --root packages/store-postgres test/pool-options.test.ts test/skip-schema-init.test.ts test/postgres-bus.test.ts test/postgres-bus-stream.test.ts test/listen-tail.test.ts— 31 passed.A throwaway check, not in this diff: a connection string still notifies, and
pg_advisory_lockstays off the pool. RemovingschemaInitialized = truefails that check (the pool runs the lock). A{ pool }with no tail still notifies, andcrossesProcessesstays false.No product behavior change. Do not merge.