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

Logical Replication #899

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

Zvirovyi
Copy link
Contributor

@Zvirovyi Zvirovyi commented Mar 21, 2025

This is a copy of VM PR.

This is an implementation of the Logical Replication specification (WIP): https://docs.google.com/document/d/1f84Z4cZwUD4q4bJsXTTC_PUaZr7pPB0Q6HnQ9cgCX_o/edit?usp=sharing.

Basic testing

  1. deploy postgresql and postgresql2
  2. juju integrate postgresql:logical-replication-offer postgresql2:logical-replication
  3. create testing table with data in the postgresql: create table asd (message text); insert into asd values ('hello');
  4. create the same table on the postgresql2 side
  5. juju run postgresql/leader add-publication name=asd database=postgres tables=public.asd
  6. juju run postgresql2/leader subscribe name=asd
  7. check the table on postgresql2 side: select * from asd;
  8. add another data to the testing table and observe it was pushed to the postgresql2 subscriber

Key notes

  • K8s version does not need cluster_topology_change observer as primary endpoint is resolved automatically and always points to the right unit.

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 17.94872% with 288 lines in your changes missing coverage. Please review.

Project coverage is 70.10%. Comparing base (b5b1494) to head (3f7c03d).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/relations/logical_replication.py 16.76% 272 Missing and 6 partials ⚠️
src/backups.py 28.57% 4 Missing and 1 partial ⚠️
src/patroni.py 16.66% 5 Missing ⚠️

❌ Your patch check has failed because the patch coverage (17.94%) is below the target coverage (33.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #899      +/-   ##
==========================================
- Coverage   75.05%   70.10%   -4.96%     
==========================================
  Files          13       14       +1     
  Lines        3704     4054     +350     
  Branches      548      625      +77     
==========================================
+ Hits         2780     2842      +62     
- Misses        718      999     +281     
- Partials      206      213       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Zvirovyi Zvirovyi marked this pull request as ready for review March 25, 2025 11:53
Copy link
Member

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

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

The code looks great! I'll only do some more testing tomorrow.

Copy link
Member

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

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

LGTM!

@dragomirp dragomirp added the enhancement New feature, UI change, or workload upgrade label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, UI change, or workload upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants