Skip to content

fix: preserve transaction commit LSN on live events - #54

Merged
psteinroe merged 1 commit into
mainfrom
fix/commit-lsn
Jul 21, 2026
Merged

fix: preserve transaction commit LSN on live events#54
psteinroe merged 1 commit into
mainfrom
fix/commit-lsn

Conversation

@psteinroe

@psteinroe psteinroe commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Preserve the logical replication transaction commit LSN when live inserts are converted into triggered events. This gives downstream sinks a commit-safe consistency watermark instead of losing it at the core conversion boundary.

Recovery LSN Semantics

Adds a separate optional commit_lsn field while keeping the existing trigger-time lsn unchanged for slot recovery. convert_event_from_table now constructs both values explicitly: live inserts provide their transaction commit LSN, while replayed table rows and persisted checkpoints leave it absent.

Regression coverage verifies distinct row (0/100) and commit (0/200) LSNs through the live conversion path and verifies COPY-replayed rows retain only the row LSN. A full pipeline test executes a source INSERT and UPDATE in one transaction and proves both emitted events share one commit LSN while each trigger-time row LSN differs from it. Existing slot recovery tests remain green.

@psteinroe
psteinroe merged commit a8ecdcd into main Jul 21, 2026
6 checks 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