Skip to content

feat!: split acknowledge config into autoAck + keepaliveIntervalSeconds (v3.0.1)#176

Open
kibae wants to merge 2 commits into
mainfrom
release/3.0.1
Open

feat!: split acknowledge config into autoAck + keepaliveIntervalSeconds (v3.0.1)#176
kibae wants to merge 2 commits into
mainfrom
release/3.0.1

Conversation

@kibae
Copy link
Copy Markdown
Owner

@kibae kibae commented Apr 21, 2026

Summary

  • Replace nested acknowledge: { auto, timeoutSeconds } with top-level autoAck and
    keepaliveIntervalSeconds. The old shape bundled two independent concerns — auto-ack on
    data messages vs. periodic keepalive — which caused the replication slot to silently
    advance past unacknowledged work when auto: false was set
    (#174).
  • Track received LSN and acknowledged LSN separately internally. The keepalive timer now
    reports only the last manually acknowledged LSN as the flushed/applied position, so
    autoAck: false users can rely on the slot staying put.
  • Deprecated acknowledge key is still accepted in v3.x with a console.warn and value
    mapping; scheduled for removal in v4.0.

Migration

- new LogicalReplicationService(clientConfig, {
-   acknowledge: { auto: false, timeoutSeconds: 10 },
- });
+ new LogicalReplicationService(clientConfig, {
+   autoAck: false,
+   keepaliveIntervalSeconds: 10,
+ });

Prominent notice added at the top of README.md; full details in CHANGELOG.md.

Test plan

  • npx tsc --noEmit passes
  • jest config-normalize — 4/4 unit tests pass (defaults, new keys, deprecated shim
    with warning, precedence when both supplied)
  • Run full Jest suite against PostgreSQL 14/15/16/17/18 via CI
  • Manually verify autoAck: false, keepaliveIntervalSeconds: 10 keeps connection
    alive without advancing pg_replication_slots.confirmed_flush_lsn
  • Manually verify deprecated acknowledge: { auto, timeoutSeconds } still works
    with warning

Closes #174

…ds (v3.0.1)

The old `acknowledge: { auto, timeoutSeconds }` shape bundled two unrelated
concerns — automatic per-message ack vs. periodic keepalive — which caused
the slot to silently advance when `auto: false` was configured (#174).

Public API changes:
- Replace nested `acknowledge` with top-level `autoAck` and `keepaliveIntervalSeconds`
- Deprecated `acknowledge` key is still accepted for v3.x with a console.warn;
  scheduled for removal in v4.0

Internal changes:
- Track received LSN and acknowledged LSN separately
- Keepalive timer now reports only the last acknowledged LSN as the flushed/applied
  position, so the replication slot never advances past unacknowledged work
The fire-and-forget _acknowledge(lsn) call in the copyData handler and the
async setInterval callback in checkStandbyStatus both leaked promise
rejections, which can crash Node on unhandled rejection. Attach .catch()
to each and surface failures via the existing 'error' event.
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.

Periodic standby status update ignores auto: false, silently advancing replication slot position

1 participant