Skip to content

Commit a5debfe

Browse files
committed
feat(pageserver): enable reldirv2 by default in regress tests, try 2
Signed-off-by: Alex Chi Z <[email protected]>
1 parent fe7a4e1 commit a5debfe

File tree

13 files changed

+193
-70
lines changed

13 files changed

+193
-70
lines changed

control_plane/src/pageserver.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@ impl PageServerNode {
571571
.map(|x| x.parse::<bool>())
572572
.transpose()
573573
.context("Failed to parse 'basebackup_cache_enabled' as bool")?,
574+
rel_size_v1_access_disabled: settings
575+
.remove("rel_size_v1_access_disabled")
576+
.map(|x| x.parse::<bool>())
577+
.transpose()
578+
.context("Failed to parse 'rel_size_v1_access_disabled' as bool")?,
574579
};
575580
if !settings.is_empty() {
576581
bail!("Unrecognized tenant settings: {settings:?}")

libs/pageserver_api/src/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,9 @@ pub struct TenantConfigToml {
651651
// FIXME: Remove skip_serializing_if when the feature is stable.
652652
#[serde(skip_serializing_if = "std::ops::Not::not")]
653653
pub basebackup_cache_enabled: bool,
654+
655+
#[serde(skip_serializing_if = "std::ops::Not::not")]
656+
pub rel_size_v1_access_disabled: bool,
654657
}
655658

656659
pub mod defaults {
@@ -959,6 +962,7 @@ impl Default for TenantConfigToml {
959962
sampling_ratio: None,
960963
relsize_snapshot_cache_capacity: DEFAULT_RELSIZE_SNAPSHOT_CACHE_CAPACITY,
961964
basebackup_cache_enabled: false,
965+
rel_size_v1_access_disabled: false,
962966
}
963967
}
964968
}

libs/pageserver_api/src/models.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

788793
impl 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")]
15311546
pub 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

Comments
 (0)