@@ -646,6 +646,8 @@ pub struct TenantConfigPatch {
646646 pub relsize_snapshot_cache_capacity : FieldPatch < usize > ,
647647 #[ serde( skip_serializing_if = "FieldPatch::is_noop" ) ]
648648 pub basebackup_cache_enabled : FieldPatch < bool > ,
649+ #[ serde( skip_serializing_if = "FieldPatch::is_noop" ) ]
650+ pub rel_size_v1_access_disabled : FieldPatch < bool > ,
649651}
650652
651653/// Like [`crate::config::TenantConfigToml`], but preserves the information
@@ -783,6 +785,9 @@ pub struct TenantConfig {
783785
784786 #[ serde( skip_serializing_if = "Option::is_none" ) ]
785787 pub basebackup_cache_enabled : Option < bool > ,
788+
789+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
790+ pub rel_size_v1_access_disabled : Option < bool > ,
786791}
787792
788793impl TenantConfig {
@@ -830,6 +835,7 @@ impl TenantConfig {
830835 mut sampling_ratio,
831836 mut relsize_snapshot_cache_capacity,
832837 mut basebackup_cache_enabled,
838+ mut rel_size_v1_access_disabled,
833839 } = self ;
834840
835841 patch. checkpoint_distance . apply ( & mut checkpoint_distance) ;
@@ -939,6 +945,9 @@ impl TenantConfig {
939945 patch
940946 . basebackup_cache_enabled
941947 . apply ( & mut basebackup_cache_enabled) ;
948+ patch
949+ . rel_size_v1_access_disabled
950+ . apply ( & mut rel_size_v1_access_disabled) ;
942951
943952 Ok ( Self {
944953 checkpoint_distance,
@@ -980,6 +989,7 @@ impl TenantConfig {
980989 sampling_ratio,
981990 relsize_snapshot_cache_capacity,
982991 basebackup_cache_enabled,
992+ rel_size_v1_access_disabled,
983993 } )
984994 }
985995
@@ -1094,6 +1104,9 @@ impl TenantConfig {
10941104 basebackup_cache_enabled : self
10951105 . basebackup_cache_enabled
10961106 . unwrap_or ( global_conf. basebackup_cache_enabled ) ,
1107+ rel_size_v1_access_disabled : self
1108+ . rel_size_v1_access_disabled
1109+ . unwrap_or ( global_conf. rel_size_v1_access_disabled ) ,
10971110 }
10981111 }
10991112}
@@ -1526,12 +1539,15 @@ pub struct OffloadedTimelineInfo {
15261539 pub archived_at : chrono:: DateTime < chrono:: Utc > ,
15271540}
15281541
1529- #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
1542+ /// The state of the rel size migration. This is persisted in the DbDir key and index part. Do not change without considering
1543+ /// compatibility.
1544+ #[ derive( Default , Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
15301545#[ serde( rename_all = "camelCase" ) ]
15311546pub enum RelSizeMigration {
15321547 /// The tenant is using the old rel_size format.
15331548 /// Note that this enum is persisted as `Option<RelSizeMigration>` in the index part, so
15341549 /// `None` is the same as `Some(RelSizeMigration::Legacy)`.
1550+ #[ default]
15351551 Legacy ,
15361552 /// The tenant is migrating to the new rel_size format. Both old and new rel_size format are
15371553 /// persisted in the storage. The read path will read both formats and validate them.
0 commit comments