refactor(db): Add MVE scheduler support#1243
Open
michalkrzyz wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors MariaDB “post-migration” behavior by introducing an MVE (Materialized View Engine) scheduler that periodically triggers MV refresh stored procedures, while removing the legacy post-migration procedure registry mechanism and adapting e2e migration tests accordingly.
Changes:
- Add an MVE scheduler/trigger implementation in the MariaDB layer and integrate it into the migration flow.
- Remove the legacy
post_migration_procedure_registrytable and related stored procedures via a new migration. - Update e2e DB migration tests/fixtures to stop using the removed post-migration registry and instead configure MVE procedures directly.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/database/mariadb/mve.go | Introduces MVE trigger + scheduler implementation and first-run wait signaling. |
| internal/database/mariadb/migration.go | Switches post-migration handling to MVE scheduler (async) and TriggerMVE (sync), and changes WaitPostMigrations semantics. |
| internal/database/interface.go | Updates Database interface to make WaitPostMigrations non-error-returning. |
| internal/app/heureka.go | Aligns app wrapper method signature with updated database interface. |
| internal/e2e/common/server.go | Updates server startup helper to call WaitPostMigrations without asserting on an error return. |
| internal/e2e/db_migration_test.go | Adjusts e2e migration setup to configure MVE procedures and removes post-migration registry fixture usage. |
| internal/e2e/migrations/70250915164215_add_post_migration.up.sql | Removes obsolete e2e migration fixture that registered a post-migration procedure. |
| internal/e2e/migrations/70250915164215_add_post_migration.down.sql | Removes obsolete e2e migration fixture down script. |
| internal/database/mariadb/migrations/20260701112108_app_scheduler.up.sql | Drops legacy post-migration registry table/procedures. |
| internal/database/mariadb/migrations/20260701112108_app_scheduler.down.sql | Restores legacy post-migration registry table/procedures on rollback. |
| go.mod | Adds scheduler-related dependencies (includes an apparently unused gocron/v2 entry). |
| go.sum | Updates module sums for the newly introduced dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
509b671 to
15a3e8c
Compare
a815820 to
ad72c15
Compare
81392d0 to
117231f
Compare
On-behalf-of: SAP Michal Krzyz <michal.krzyz@sap.com> Signed-off-by: Michal Krzyz <michalkrzyz@gmail.com>
117231f to
44f68af
Compare
On-behalf-of: SAP Michal Krzyz <michal.krzyz@sap.com> Signed-off-by: Michal Krzyz <michalkrzyz@gmail.com>
4626040 to
38f615d
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On-behalf-of: SAP Michal Krzyz michal.krzyz@sap.com
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Added tests?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Added to documentation?
Checklist