-
Notifications
You must be signed in to change notification settings - Fork 496
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
feat(pageserver): persist reldir v2 migration status #10980
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Alex Chi Z <chi@neon.tech>
705 tests run: 659 passed, 0 failed, 46 skipped (full report)Test coverage report is not availableThe comment gets automatically updated with the latest test results
3044fb6 at 2025-02-25T23:39:17.096Z :recycle: |
self.rel_size_v2_status | ||
.store(Some(Arc::new(rel_size_v2_status.clone()))); |
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.
We should update this after the index upload is scheduled, since it can fail.
Also, nit: this is a bare enum, so we can derive Copy
and avoid the cloning.
@@ -2380,6 +2385,13 @@ impl Timeline { | |||
.unwrap_or(self.conf.default_tenant_conf.rel_size_v2_enabled) | |||
} | |||
|
|||
pub(crate) fn get_rel_size_v2_status(&self) -> Option<RelSizeMigration> { |
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.
nit: would it be easier to just unwrap this to Legacy
instead of propagating the None
?
@@ -1719,6 +1722,34 @@ impl DatadirModification<'_> { | |||
Ok(()) | |||
} | |||
|
|||
/// Returns `true` if the rel_size_v2 write path is enabled. If it is the first time that | |||
/// we enable it, we also need to persist it in `index_part.json`. | |||
pub fn do_enable_rel_size_v2(&mut self) -> anyhow::Result<bool> { |
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.
nit: consider maybe_enable_rel_size_v2
since it is conditional.
Problem
part of #9516
Summary of changes
Similar to the aux v2 migration, we persist the relv2 migration status into index_part, so that even the config item is set to false, we will still read from the v2 storage to avoid loss of data.
Note that only the two variants
None
andSome(RelSizeMigration::Migrating)
are used for now. We don't have full migration implemented so it will never be set toRelSizeMigration::Migrated
.