-
Notifications
You must be signed in to change notification settings - Fork 971
upgrade redb file format to v3 #7917
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
Open
owanikin
wants to merge
27
commits into
sigp:unstable
Choose a base branch
from
owanikin:upgrade-redb-v3
base: unstable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
47a7ee2
upgrade redb file format to v3
owanikin 9f8a43f
WIP: migration_schema_v29 changes
owanikin 04728b5
WIP: logging if migration happened successfully or not
owanikin e6806cd
WIP: migration_schema_v29 changes
owanikin 4fe948d
fix formatting and linting issues
owanikin 0a94f45
some hacking
eserilev 86fa5bf
WIP: some hacking upgrade-reddb-v3
owanikin 2c82eb3
Add ability to upgrade and check if redb
eserilev 30c4666
cargo
eserilev 7a6a492
Merge conflicts
eserilev 798b6bf
upgradedredb v3
owanikin 8beedc3
upgrade-redb-v3 cleanup
owanikin 04c4641
fix ci issues
owanikin 9f7fd90
Merge branch 'unstable' into upgrade-redb-v3
eserilev 37ca640
Merge branch 'unstable' into upgrade-redb-v3
eserilev 03583dd
Merge branch 'unstable' into upgrade-redb-v3
eserilev f268bac
fix: markdown lint table format (advanced_database)
owanikin 63b7515
fix: markdown lint table format (api_vc_endpoints)
owanikin 2062243
fix: markdown lint table format (archived_merge_migration)
owanikin 86a7618
fix: markdownlint table formatting
owanikin 89ff98c
Merge branch 'unstable' into upgrade-redb-v3
owanikin b249a79
Resolve merge conflicts
eserilev 8a3eab9
Revert
eserilev fa2cbe4
Revert
eserilev 5dab081
2.6.3
eserilev f3dee1b
2.6.3
eserilev 43756dd
Merge branch 'unstable' into upgrade-redb-v3
eserilev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
beacon_node/beacon_chain/src/schema_change/migration_schema_v29.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| use crate::BeaconChainTypes; | ||
| use std::sync::Arc; | ||
| use store::{Error, HotColdDB, KeyValueStoreOp}; | ||
|
|
||
| pub fn upgrade_to_v29<T: BeaconChainTypes>( | ||
| db: Arc<HotColdDB<T::EthSpec, T::HotStore, T::ColdStore>>, | ||
| ) -> Result<Vec<KeyValueStoreOp>, Error> { | ||
| db.upgrade()?; | ||
| Ok(vec![]) | ||
| } | ||
|
|
||
| pub fn downgrade_from_v29<T: BeaconChainTypes>( | ||
| db: Arc<HotColdDB<T::EthSpec, T::HotStore, T::ColdStore>>, | ||
| ) -> Result<Vec<KeyValueStoreOp>, Error> { | ||
| if db.is_redb() { | ||
| return Err(Error::MigrationError( | ||
| "Downgrade from v29 not supported for Redb".into(), | ||
| )); | ||
| } | ||
| Ok(vec![]) | ||
| } |
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
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
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
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
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
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
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
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
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.
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.
note thta
upgradereturns true is successful and false if its already in the v3 formathttps://docs.rs/redb/2.6.2/redb/struct.Database.html#method.upgrade
In all other failure cases it will raise an error