Skip to content

fix another deadlock while streaming cdc - #71

Merged
hasyimibhar merged 1 commit into
mainfrom
fix/cdc-standby-ack-events-channel-full
Jun 3, 2026
Merged

hasyimibhar merged 1 commit into
mainfrom
fix/cdc-standby-ack-events-channel-full

Conversation

@hasyimibhar

@hasyimibhar hasyimibhar commented Jun 3, 2026 •

Copy link
Copy Markdown
Collaborator

Similar to #70, it's a deadlock found while working on benchmark, it only happens under sustained write load.

Fixed by routing every event send through send_servicing_cmds, which select!s the send permit (events_tx.reserve()) against cmd_rx.recv(). A Standby is now acked even when the events channel is full → main loop resumes → drains the channel → frees a slot → the send completes. Cmd handling is factored into handle_cmd, shared by the main select! arm and the send-wait path.

@hasyimibhar
hasyimibhar force-pushed the fix/cdc-standby-ack-events-channel-full branch from ab4b1b2 to 0188cfb Compare June 3, 2026 07:29
@hasyimibhar
hasyimibhar force-pushed the fix/cdc-standby-ack-events-channel-full branch from 0188cfb to 57b51c3 Compare June 3, 2026 07:30
@hasyimibhar hasyimibhar changed the title fix(pg): service standby acks while the events channel is full fix another deadlock while streaming cdc Jun 3, 2026
@hasyimibhar
hasyimibhar merged commit 546bca6 into main Jun 3, 2026
4 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