-
Notifications
You must be signed in to change notification settings - Fork 1.4k
integration: fix database not initialized in run_migrations #16762
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
Merged
AskAlexSharov
merged 2 commits into
main
from
canepat/run_migrations_fix_database_not_initialized
Aug 22, 2025
Merged
integration: fix database not initialized in run_migrations #16762
AskAlexSharov
merged 2 commits into
main
from
canepat/run_migrations_fix_database_not_initialized
Aug 22, 2025
Conversation
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
JkLondon
approved these changes
Aug 21, 2025
AskAlexSharov
requested changes
Aug 22, 2025
cmd/integration/commands/stages.go
Outdated
| // (see openSnapshotOnce in allSnapshots below). | ||
| migrateDB(kv.ChainDB, chaindata) | ||
|
|
||
| dbPaths := map[kv.Label]string{} |
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.
- if chaindata must be first - then just don't use
mapuse array.
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.
you're right, this can be simplified. neither a map nor an array is needed: I'll just call migrateDB instead of filling a useless data structure
AskAlexSharov
approved these changes
Aug 22, 2025
canepat
added a commit
that referenced
this pull request
Sep 1, 2025
canepat
added a commit
that referenced
this pull request
Sep 1, 2025
AskAlexSharov
pushed a commit
that referenced
this pull request
Sep 2, 2025
…16935) Cherry-pick #16678 Cherry-pick #16711 Cherry-pick #16762 --------- Co-authored-by: Shoham Chakraborty <[email protected]>
yperbasis
pushed a commit
that referenced
this pull request
Sep 12, 2025
…16936) Cherry-pick #16678 Cherry-pick #16711 Cherry-pick #16762 --------- Co-authored-by: Shoham Chakraborty <[email protected]>
NazariiDenha
pushed a commit
that referenced
this pull request
Oct 24, 2025
After adding `integration run_migrations` step within RPC Integration Tests, some runs started to fail intermittently on Gnosis and Polygon with error "database is not initialized": https://github.com/erigontech/erigon/actions/runs/17097843879/job/48486419048 https://github.com/erigontech/erigon/actions/runs/17097843833/job/48486419046 https://github.com/erigontech/erigon/actions/runs/17099664503/job/48492523550 It turns out the unpredictable order of range iteration over `dbPaths` map can lead any database different from `chaindata` to be opened as first, which triggers the `openSnapshotOnce` function to be executed on a database with empty `Config` table, hence the error. This guarantees that `chaindata` is always migrated as first.
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.
After adding
integration run_migrationsstep within RPC Integration Tests, some runs started to fail intermittently on Gnosis and Polygon with error "database is not initialized":https://github.com/erigontech/erigon/actions/runs/17097843879/job/48486419048
https://github.com/erigontech/erigon/actions/runs/17097843833/job/48486419046
https://github.com/erigontech/erigon/actions/runs/17099664503/job/48492523550
It turns out the unpredictable order of range iteration over
dbPathsmap can lead any database different fromchaindatato be opened as first, which triggers theopenSnapshotOncefunction to be executed on a database with emptyConfigtable, hence the error.This guarantees that
chaindatais always migrated as first.