fix(database): SQL live-update queue, PK, and topology interventions - #1607
Merged
kkopanidis merged 2 commits intoSep 13, 2026
Merged
Conversation
Persist resume tokens after a successful emit, serialize consume, and trim the changelog only after Redis ack. Triggers use the schema PK, LISTEN is probed, Redis keys are SQL-scoped, and opt-out no longer recreates live triggers.
Same-name cnd_rt_* triggers from #1602 still pointed at conduit_realtime_capture / inline _id. DROP and CREATE when the function or body does not match the physical PK so custom-PK DML no longer aborts. Document the 750ms occurred_at lag window.
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.
Intervention into #1602. Do not restack or merge #1602 into #1601. Do not merge #1600 / #1601 / #1602. Replay this delta after the Mongo restack.
Independent grok of #1602 @
30314798found P1s: trim-before-publish, overlappinghandleChange, hardcoded_id, autoincrement holes. This PR closes those plus the P2 ops gaps, then retargets leftover same-name#1602triggers.Queue (P1)
handleChange. Persist resume after successful bus +socketPush(at-least-once duplicates OK).MAX(id)before attaching new triggers. Do not jump to liveMAX(id)on a leftover Mongo token.Triggers / topology (P1/P2)
SequelizeSchema.idField, not a virtual_id. NULL PKs skip the log insert instead of aborting DML.cnd_rt_*triggers: if the existing function/body/PK does not match, DROP then CREATE once. Name equality is not “already correct.” DROP leftovers only on opt-out / global disable. Do not create the changelog table when realtime is globally off.checkTopologyprobesSELECT 1and PostgresLISTENon a dedicated session client.realtime:sql:resumeToken/realtime:sql:change-stream:leader.parseSqlResumeIdis wired intowatch().Semantics copied from Mongo #1605
UNAVAILABLE;removeUseronly on deny.rebacCache.ts(that lands from the Mongo restack).Docs / tests
README and status say this is an internal change queue, not native CDC (privileges, session-mode LISTEN / pooler, write amplification, no TRUNCATE, 750ms lag window). Tests cover persist-after-emit, emit-failure, UNAVAILABLE membership, leftover Mongo tokens, leftover
#1602_idtriggers retargeted ontosku, NULL PK skip after retarget, disable-without-breaking-DML,prepare({ ensureLog: false }), LISTEN failure, notify-during-drain, andprepare()watermark start.Independent grok of this intervention @
38d81100: no P0/P1/P2. Snyk inherited from parents is not a merge bar.