Skip to content

Speed up CDC apply transaction replay - #8

Merged
tbarbugli merged 6 commits into
mainfrom
bounded-cdc-catchup
Aug 14, 2026
Merged

Speed up CDC apply transaction replay#8
tbarbugli merged 6 commits into
mainfrom
bounded-cdc-catchup

Conversation

@tbarbugli

Copy link
Copy Markdown
Member

Summary

  • configure replica role once per dedicated apply connection and cache source-definition-aware target metadata
  • pipeline source-ordered DML in bounded windows while validating every result and affected-row count before commit
  • collapse stream identity validation and durable progress bookkeeping into one guarded statement

Test plan

  • gofmt, go vet ./..., go test ./..., and go test -race ./...
  • govulncheck for the command and internal packages
  • PG17 CDC and app integration suites
  • migration end-to-end suite
  • crash-recovery end-to-end suite

Made with Cursor

tbarbugli and others added 6 commits August 14, 2026 18:03
Keep trigger suppression on the dedicated connection to remove a target round trip from every replayed transaction.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse validated target mappings until pgoutput reports a changed source definition, avoiding repeated catalog queries on hot tables.

Co-authored-by: Cursor <cursoragent@cursor.com>
Queue source-ordered DML in bounded windows and validate every result before transactional progress or commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
Validate stream identity, mark first progress, and upsert the durable LSN in one guarded statement.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse exact SQL and parameter type parses across source transactions while bounding long-lived session state with protocol-level LRU eviction.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fold BEGIN into replay and guard progress plus COMMIT in one final window so mismatches abort server-side before data can commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tbarbugli
tbarbugli merged commit c7135bf into main Aug 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant