-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sync-service): Query Postgres server version at the start of conn…
…ection setup (#1784) We were querying it after starting the replication client before, which was too late, because by that time the shape recovery process might have already reached `Electric.Postgres.Configuration.configure_tables_for_replication!()` where the version is used to branch the control flow. This was causing flake in integration tests due to the version not always being there and the unsupported query being issue against Postgres version 14. In short, this PR resolves the flakiness in integration tests, they should be consistently green from now on. The choice of augmenting the `LockConnection` module with version querying and a crude state machine might seem dubious but the end result is simpler this way, compared to adding version querying to the replication client, for example.
- Loading branch information
Showing
5 changed files
with
60 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@core/sync-service": patch | ||
--- | ||
|
||
Query Postgres server version as early as possible so that it is available throughout the whole connection initialization process. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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