-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Background primary determiner #121 #171
Conversation
feat: reference change for connection to primary node by background task fix: cluster container names must be unique, so they are generated using the uuid Signed-off-by: Antipin Alexey <evreke@gmail.com>
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #171 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 720 727 +7
===========================================
Files 110 110
Lines 1520 1542 +22
Branches 119 119
===========================================
+ Hits 1520 1542 +22
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Show resolved
Hide resolved
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Show resolved
Hide resolved
src/test/java/io/github/mfvanek/pg/support/PostgresSqlClusterWrapper.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionClusterTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionClusterTest.java
Outdated
Show resolved
Hide resolved
* DbMigrationGenerator was made generic * Added ColumnWithSerialTypeMigrationGenerator * Added tests * Updated deps * Fixed code smells Co-authored-by: Ivan Vakhrushev <i.vakhrushev@banki.ru>
Co-authored-by: Ivan Vakhrushev <mfvanek@gmail.com>
* Making abstract classes package private * Fixed code smell Co-authored-by: Ivan Vakhrushev <i.vakhrushev@banki.ru>
Co-authored-by: Ivan Vakhrushev <i.vakhrushev@banki.ru>
Co-authored-by: Ivan Vakhrushev <i.vakhrushev@banki.ru>
…179) * Updated sql query * Added test to cover the issue Co-authored-by: Ivan Vakhrushev <i.vakhrushev@banki.ru>
Co-authored-by: Ivan Vakhrushev <mfvanek@gmail.com>
Co-authored-by: Ivan Vakhrushev <mfvanek@gmail.com>
change: resolve comments Signed-off-by: Antipin Alexey <evreke@gmail.com>
f040c47
to
cab39ab
Compare
I can't understand why codecov shows me some lines partially covered. @mfvanek please, need help here. |
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Show resolved
Hide resolved
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Outdated
Show resolved
Hide resolved
@Evreke you should implement a test when primary host doesn't change within a delay period |
|
src/test/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionClusterTest.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/mfvanek/pg/connection/HighAvailabilityPgConnectionImpl.java
Outdated
Show resolved
Hide resolved
It turns out that it's not easy to test such case without reconfiguring cluster. Definitely, we should be able to run a separate cluster for each test. @mfvanek should I create a issue for this or I can implement such feature right here? |
@Evreke |
change: resolve comments Signed-off-by: Antipin Alexey <evreke@gmail.com>
e7ddecb
to
831973f
Compare
… SuppressFBWarnings. 2) Added javadoc to HighAvailabilityPgConnectionImpl 3) Refactored construction methods in HighAvailabilityPgConnectionImpl. 4) Mocked tests moved to HighAvailabilityPgConnectionUnitTest with "fast" tag. 5) ClusterAwareTestBase renamed to PgConnectionAwareCluster 6) Implemented AutoCloseable for all Testcontainers wrappers. 6) Migrated tests to try-with-resources.
Kudos, SonarCloud Quality Gate passed! |
This feature makes the HighAvailabilityPgConnectionImpl responsible for monitoring and dynamically changing reference to the primary postgres node in the cluster.