-
Notifications
You must be signed in to change notification settings - Fork 382
fix(connectors): defer postgres source progress until ack #3957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rohankumardubey
wants to merge
3
commits into
apache:master
Choose a base branch
from
rohankumardubey:fix/postgres-source-ack
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -209,7 +209,7 @@ LIMIT $limit | |
|
|
||
| ### Delete After Read | ||
|
|
||
| Deletes rows from the source table after successful processing: | ||
| Deletes rows from the source table only after Iggy acknowledges the batch: | ||
|
|
||
| ```toml | ||
| [plugin_config] | ||
|
|
@@ -219,7 +219,7 @@ primary_key_column = "id" | |
|
|
||
| ### Mark as Processed | ||
|
|
||
| Updates a boolean column instead of deleting: | ||
| Updates a boolean column after Iggy acknowledges the batch instead of deleting: | ||
|
|
||
| ```toml | ||
| [plugin_config] | ||
|
|
@@ -267,15 +267,20 @@ tables = ["users", "orders"] | |
| capture_operations = ["INSERT", "UPDATE", "DELETE"] | ||
| ``` | ||
|
|
||
| The connector peeks at logical changes and advances the replication slot only | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. worth one sentence on cost: advancing the slot re-decodes the same wal range (fast-forward), so each acked batch pays two decode passes. |
||
| after Iggy acknowledges the batch. A failed delivery leaves the slot unchanged | ||
| so the next poll can read the same changes again. | ||
|
|
||
| The `pg_replicate` backend requires the `cdc_pg_replicate` feature flag at build time. | ||
|
|
||
| ### Slot Naming | ||
|
|
||
| Each CDC connector must use a unique `replication_slot`. Setup accepts any | ||
| pre-existing `test_decoding` slot, so two connectors pointed at the same | ||
| database with the default `replication_slot = "iggy_slot"` will silently | ||
| share one slot. `pg_logical_slot_get_changes` consumes changes on read, so | ||
| each connector only sees a subset of the other's changes instead of erroring. | ||
| share one slot. Each connector peeks from and advances the same slot after | ||
| delivery, so one connector can move the shared position past changes that the | ||
| other has not processed. | ||
| Set an explicit, distinct `replication_slot` per connector instance. | ||
|
|
||
| ### Decommissioning | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth documenting the window: state is persisted before the delete runs, so a crash/shutdown/timeout in between leaves rows delivered but never deleted, and the advanced offset means they are never picked up again.