-
Notifications
You must be signed in to change notification settings - Fork 925
Slasher redb upgrade #8084
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
base: unstable
Are you sure you want to change the base?
Slasher redb upgrade #8084
Conversation
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.
Thanks! I took a brief look and requested some changes
also the match(schema_version, CURRENT_SCHEMA_VERSION)
has some cases that look a bit weird to me, I'll take a deeper look once we've cleaned this PR up a bit.
pub fn upgrade(&self) -> Result<(), Error> { | ||
tracing::info!("Checking SlasherDB Redb internals for upgrade"); | ||
Ok(()) | ||
} |
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.
should this function be upgrading the db?
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.
Right now, this upgrade()
in redb_impl.rs
is just a backend hook.
The actual schema version check and upgrade orchestration happens in slasher/src/migrate.rs
(via SlasherDB::migrate
), which calls self.env.upgrade()
and then writes the new schema version into the metadata_db
.
For Redb specifically, there aren’t any low-level internal migrations needed at the moment, so this is effectively a no-op.
I left the function in place so the Redb backend matches the Environment interface and can support backend-specific migrations in the future if needed.
Issue Address
#8048
Started addressing the Slasher database migration requirement for Redb as discussed.
Proposed Changes
upgrade()
support for Redb inslasher/src/database/redb_impl.rs
.upgrade()
intoslasher/src/database/interface.rs
.slasher/src/migrate.rs
.Additional Info