-
Notifications
You must be signed in to change notification settings - Fork 322
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
refactor: safe database initialisation and schema migration during startup #2734
Conversation
Codecov ReportBase: 46.63% // Head: 46.79% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2734 +/- ##
==========================================
+ Coverage 46.63% 46.79% +0.15%
==========================================
Files 297 297
Lines 48696 48830 +134
==========================================
+ Hits 22711 22850 +139
+ Misses 24557 24527 -30
- Partials 1428 1453 +25
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. |
3b7a7d6
to
1b81a06
Compare
6bacfbc
to
b473414
Compare
b473414
to
2d32146
Compare
App app.App | ||
VersionHandler func(w http.ResponseWriter, r *http.Request) | ||
// embeddedApp is the type for embedded type implementation | ||
type embeddedApp struct { |
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.
Nice job with unexporting these types 👍
Description
When running in
embedded
mode (core & warehouse) and using separate database instances for core & warehouse data, it is possible that one database's unavailability panic may cause the other database's schema migration to become dirty (corrupted) due to the asynchronous nature of the two components' startup sequence.To eliminate this, we are now initialising both databases sequentially and stop the process gracefully in case of an error. Database initialisation for reach component happens only if the component needs to be started.
Other improvements:
apphandlers
package to remove global variablesrunner
&apphandler
scenariosNotion Ticket
Link
Security