diff --git a/control_plane/src/storage.rs b/control_plane/src/storage.rs index 4b9fbe7c08..b1e5872b6e 100644 --- a/control_plane/src/storage.rs +++ b/control_plane/src/storage.rs @@ -352,6 +352,9 @@ impl PageServerNode { checkpoint_distance: settings .get("checkpoint_distance") .map(|x| x.parse::().unwrap()), + compaction_target_size: settings + .get("compaction_target_size") + .map(|x| x.parse::().unwrap()), compaction_period: settings.get("compaction_period").map(|x| x.to_string()), gc_horizon: settings .get("gc_horizon") diff --git a/pageserver/src/config.rs b/pageserver/src/config.rs index 3605b5716a..85646406e2 100644 --- a/pageserver/src/config.rs +++ b/pageserver/src/config.rs @@ -150,6 +150,7 @@ pub const TENANT_CONFIG_NAME: &str = "config"; #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub struct TenantConf { pub checkpoint_distance: u64, + pub compaction_target_size: u64, pub compaction_period: Duration, pub gc_horizon: u64, pub gc_period: Duration, @@ -164,6 +165,7 @@ impl TenantConf { pitr_interval: conf.pitr_interval, checkpoint_distance: conf.checkpoint_distance, compaction_period: conf.compaction_period, + compaction_target_size: conf.compaction_target_size, } } pub fn save(&self, conf: &'static PageServerConf, tenantid: ZTenantId) -> Result<()> { diff --git a/pageserver/src/http/models.rs b/pageserver/src/http/models.rs index 6131515210..3c93b01638 100644 --- a/pageserver/src/http/models.rs +++ b/pageserver/src/http/models.rs @@ -26,6 +26,7 @@ pub struct TenantCreateRequest { #[serde_as(as = "Option")] pub new_tenant_id: Option, pub checkpoint_distance: Option, + pub compaction_target_size: Option, pub compaction_period: Option, pub gc_horizon: Option, pub gc_period: Option, @@ -47,6 +48,7 @@ impl TenantCreateRequest { TenantCreateRequest { new_tenant_id, checkpoint_distance: None, + compaction_target_size: None, compaction_period: None, gc_horizon: None, gc_period: None, diff --git a/pageserver/src/http/routes.rs b/pageserver/src/http/routes.rs index 5dca3bd863..7196d659a0 100644 --- a/pageserver/src/http/routes.rs +++ b/pageserver/src/http/routes.rs @@ -306,6 +306,9 @@ async fn tenant_create_handler(mut request: Request) -> Result