fix(connectors): defer postgres source progress until ack - #3957
Conversation
|
Thanks for the PR. It is labeled Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3957 +/- ##
=============================================
- Coverage 87.13% 67.79% -19.34%
Complexity 1455 1455
=============================================
Files 1273 1272 -1
Lines 215297 178678 -36619
Branches 179911 143293 -36618
=============================================
- Hits 187593 121140 -66453
- Misses 23178 52922 +29744
- Partials 4526 4616 +90
🚀 New features to boost your workflow:
|
|
/ready |
|
/request-review @hubcio |
hubcio
left a comment
There was a problem hiding this comment.
a few things without diff lines to hang them on:
.claude/skills/connector-source/SKILL.mdstill teaches the pre-ack pattern this pr removes (the "matches poll_tables" snippet writes cursors during poll, "always return state in every ProducedMessages" no longer holds for empty polls, and state-serialization failure is now a hard poll error, lib.rs:288-296) and doesn't mentionon_batch_resultat all - needs an update to the new contract.mark_or_delete_processed_rowsmaps db errors toError::InvalidRecord(lib.rs:732, :751) - misleading now that these errors surface through the ack path;Error::Connectionlikeadvance_replication_slotuses would fit better.- README.md:15 still promises offset tracking "avoid duplicates" - at-least-once redelivery means duplicates are possible; and README.md:57 documents the
poll_intervaldefault as1swhile the code fallback is10s(lib.rs:180).
|
@rohankumardubey please write |
|
/ready |
|
looks like CI is failing. |
|
The failure came from a merge-resolution type mismatch in the TLS connection-string branch. Thanks @hubcio |
|
/ready |
|
/ready |

Which issue does this PR address?
Closes #3635
Rationale
The PostgreSQL source advanced tracking offsets, deleted or marked rows, and consumed CDC changes before Iggy confirmed delivery. A failed send could therefore permanently skip source records.
What changed?
PostgreSQL polling now stages cursor updates and row operations until the runtime reports a successful batch acknowledgment. NACK discards the staged work, while ACK commits the state and performs the pending delete or mark operations.
CDC now peeks logical-slot changes and advances the slot only after acknowledgment. A deterministic regression test stops Iggy during delivery and verifies that the PostgreSQL rows are redelivered after restart.
Local Execution
cargo fmt --all -- --checkcargo clippy -p iggy_connector_postgres_source -p integration --all-features --all-targets -- -D warningsgit diff --check