This commit is contained in:
John Spray
2024-02-28 14:22:01 +00:00
parent 9085b0b7a2
commit 6686367452
3 changed files with 13 additions and 1 deletions

View File

@@ -1273,6 +1273,10 @@ impl Service {
}
}
// TODO: we need to recognize that this is an update, issue a DB
// transaction to update the shards, and _then_ apply in memory. Need
// the tenant equivalent of node_configure()
shard.config = req.config.tenant_conf.clone();
shard.schedule(scheduler)?;

View File

@@ -289,6 +289,14 @@ pub struct TenantConfig {
pub timeline_get_throttle: Option<ThrottleConfig>,
}
impl TenantConfig {
pub fn merge(&mut self, other: &TenantConfig) {
if let Some(max_lsn_wal_lag) = &other.max_lsn_wal_lag {
self.max_lsn_wal_lag = Some(*max_lsn_wal_lag);
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "kind")]
pub enum EvictionPolicy {

View File

@@ -385,7 +385,7 @@ def test_sharding_service_onboarding(
dest_tenant_after_conf_change["generation"] == dest_tenant_before_conf_change["generation"]
)
dest_tenant_conf_after = dest_ps.http_client().tenant_config(tenant_id)
assert dest_tenant_conf_after == TenantConfig.from_json(modified_tenant_conf)
assert dest_tenant_conf_after.tenant_specific_overrides == modified_tenant_conf
env.attachment_service.consistency_check()