Skip to content
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

Add support for reading replication slot #171

Merged
merged 3 commits into from
Jun 14, 2024
Merged

Conversation

lyuboxa
Copy link
Contributor

@lyuboxa lyuboxa commented Jun 14, 2024

Description

  • Read the state of the replication slot when subscription is created.
  • Ensure the starting position in CDC mode is consistent with what is available in the slot.
  • Refactor connection management to use pgxpool and allow for acquired connections to be upgraded for replication
  • Add subscription teardown method which stops and waits for wind down.

Fixes #146

Quick checks:

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

@lyuboxa lyuboxa requested a review from a team as a code owner June 14, 2024 05:43
@lyuboxa lyuboxa enabled auto-merge (squash) June 14, 2024 05:47
Copy link
Member

@lovromazgon lovromazgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense 👍

source.go Outdated Show resolved Hide resolved
source/pool/pool.go Outdated Show resolved Hide resolved
source/pool/pool.go Outdated Show resolved Hide resolved
source/logrepl/internal/replication_slot.go Outdated Show resolved Hide resolved
source/logrepl/internal/replication_slot.go Outdated Show resolved Hide resolved
source/logrepl/internal/replication_slot_test.go Outdated Show resolved Hide resolved
source/logrepl/internal/subscription.go Show resolved Hide resolved
lyuboxa and others added 3 commits June 14, 2024 10:56
* Read the state of the replication slot when subscription is created.
* Ensure the starting position in CDC mode is consistent with what is available in the slot.
* Refactor connection management to use pgxpool and allow for acquired connections to be upgraded for replication
* Add subscription teardown method which stops and waits for wind down.
@lyuboxa lyuboxa force-pushed the lk/add-replication-slot-fetch branch from 79c4c8a to 6708b6d Compare June 14, 2024 14:57
Copy link
Member

@lovromazgon lovromazgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@lyuboxa lyuboxa merged commit 125c029 into main Jun 14, 2024
3 checks passed
@lyuboxa lyuboxa deleted the lk/add-replication-slot-fetch branch June 14, 2024 15:24
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.

Bug: position can be out of range of replication slot
2 participants