-
Notifications
You must be signed in to change notification settings - Fork 27
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
✨ postgres readiness check includes migration completed #2600
✨ postgres readiness check includes migration completed #2600
Conversation
03849c6
to
61c1490
Compare
Codecov Report
@@ Coverage Diff @@
## master #2600 +/- ##
========================================
- Coverage 77.1% 77.1% -0.1%
========================================
Files 621 625 +4
Lines 24043 24094 +51
Branches 2367 2362 -5
========================================
+ Hits 18561 18581 +20
- Misses 4850 4880 +30
- Partials 632 633 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking promising!
ea85a28
to
4f2ef67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks way better now. Thanks!
6f8825a
to
06e46cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, let's hope this brings stability
0bd2bc0
to
addf0f3
Compare
What do these changes do?
We noticed in the CI that under certain conditions, a service fails to start because while connecting to the database the migration (performed by the migration service) is still not complete (Notice that the swarm does not guarantee the order of deploy of services).
We could ensure that
migration
service always start first but this does not guarantee that the migration is completed. Therefore, this PR creates a check function to ensure the caller service that the db migration has successfully completed.Hightlights of this PR:
simcore_postgres_database
utils_migration.get_current_head
to get head revision of current db (addsalembic
dependency tobase.txt
)utils_cli.py
and moves there all utilities used incli.py
utils_aiopg.py
retry_policies.py
for common tenacity-based retry policieserrors.py
to structure pg errorsservicelib
: steps towards fully depreciating aiopg utilssimcore_postgres_database
packageRelated issue/s
services start communicating with pg before or while migration is taking place, leading to startup failures
How to test