Skip to content

feat: Add Logical Replication Tests for v3 #121

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

Merged
merged 2 commits into from
Oct 1, 2023

Conversation

osaxma
Copy link
Contributor

@osaxma osaxma commented Aug 20, 2023

  • Added logical replication tests for v3
  • Handle CopyBothResponseMessage case in message handler

@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (73dd0d7) 87.42% compared to head (f20bac1) 87.28%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #121      +/-   ##
==========================================
- Coverage   87.42%   87.28%   -0.15%     
==========================================
  Files          29       29              
  Lines        2498     2500       +2     
==========================================
- Hits         2184     2182       -2     
- Misses        314      318       +4     
Files Coverage Δ
lib/src/v3/connection.dart 85.83% <100.00%> (-1.04%) ⬇️

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

@isoos isoos marked this pull request as ready for review September 30, 2023 14:05
@isoos
Copy link
Owner

isoos commented Oct 1, 2023

@osaxma: could you please rebase this PR now?

@osaxma
Copy link
Contributor Author

osaxma commented Oct 1, 2023

@isoos The tests that I added aren't passing locally (by the way, this PR only add these tests and nothing else)

I'll try to fix it today.

@osaxma osaxma changed the title feat: Logical Replication support to v3 feat: Add Logical Replication Tests Oct 1, 2023
@osaxma osaxma changed the title feat: Add Logical Replication Tests feat: Add Logical Replication Tests for v3 Oct 1, 2023
@osaxma osaxma force-pushed the implement_replication_to_v3 branch from a620c80 to f20bac1 Compare October 1, 2023 13:16
Comment on lines +606 to +614
case CopyBothResponseMessage():
// This message indicates a successful start for Streaming Replication.
// Hence, in this context, the query is complete. And from here on,
// the server will be streaming replication messages.
// But if the connection was used after this point to execute further
// queries, the server messages will be blocked.
// TODO(osaxma): Prevent executing queries when Streaming Replication
// is ongoing
await _completeQuery();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a temporary special case for Streaming Replication since CopyBothResponseMessage is only used for that. Ideally, we should stop any queries from being executed after this point to prevent blocking the server messages.

I will try updating the example repository for Steaming Replication to investigate what could go wrong and how to better handle this.

@isoos isoos merged commit e22e648 into isoos:master Oct 1, 2023
@osaxma osaxma deleted the implement_replication_to_v3 branch October 1, 2023 14:38
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.

3 participants