refactor(db): Add MVE scheduler support#1243
Open
michalkrzyz wants to merge 2 commits into
Open
Conversation
michalkrzyz
requested review from
MR2011,
copyonwrite,
dorneanu and
drochow
as code owners
July 1, 2026 16:20
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.
michalkrzyz
marked this pull request as draft
July 2, 2026 06:17
michalkrzyz
force-pushed
the
mikrzyz/issue-1031
branch
2 times, most recently
from
July 2, 2026 09:10
509b671 to
15a3e8c
Compare
michalkrzyz
marked this pull request as ready for review
July 2, 2026 09:10
michalkrzyz
marked this pull request as draft
July 3, 2026 09:12
michalkrzyz
force-pushed
the
mikrzyz/issue-1031
branch
3 times, most recently
from
July 3, 2026 11:20
a815820 to
ad72c15
Compare
michalkrzyz
marked this pull request as ready for review
July 3, 2026 11:21
michalkrzyz
force-pushed
the
mikrzyz/issue-1031
branch
2 times, most recently
from
July 3, 2026 12:57
81392d0 to
117231f
Compare
On-behalf-of: SAP Michal Krzyz <michal.krzyz@sap.com> Signed-off-by: Michal Krzyz <michalkrzyz@gmail.com>
michalkrzyz
force-pushed
the
mikrzyz/issue-1031
branch
4 times, most recently
from
July 10, 2026 08:20
e7bed1d to
3e78c80
Compare
michalkrzyz
force-pushed
the
mikrzyz/issue-1031
branch
4 times, most recently
from
July 17, 2026 09:03
f18e614 to
c10c601
Compare
michalkrzyz
force-pushed
the
mikrzyz/issue-1031
branch
from
July 17, 2026 11:13
c10c601 to
ff68ed6
Compare
On-behalf-of: SAP Michal Krzyz <michal.krzyz@sap.com> Signed-off-by: Michal Krzyz <michalkrzyz@gmail.com>
michalkrzyz
force-pushed
the
mikrzyz/issue-1031
branch
from
July 17, 2026 11:58
ff68ed6 to
c35150a
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