mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 09:52:54 +00:00
repro
This commit is contained in:
@@ -793,4 +793,12 @@ mod tests {
|
||||
Some(Duration::from_secs(5))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_vlad() {
|
||||
let tenant_conf_opt: TenantConfOpt =
|
||||
serde_json::from_str("{\"pitr_interval\": \"24h0m0s\"}").unwrap();
|
||||
let tenant_config: models::TenantConfig = tenant_conf_opt.clone().into();
|
||||
assert_eq!(tenant_config.pitr_interval.unwrap(), "24h0m0s");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1287,7 +1287,13 @@ impl TenantShard {
|
||||
attached_location_conf(generation, &self.shard, &self.config, &self.policy);
|
||||
match self.observed.locations.get(&node_id) {
|
||||
Some(conf) if conf.conf.as_ref() == Some(&wanted_conf) => {}
|
||||
Some(_) | None => {
|
||||
Some(conf) => {
|
||||
tracing::info!("Wanted: {wanted_conf:?}");
|
||||
tracing::info!("Observed: {conf:?}");
|
||||
|
||||
dirty_nodes.insert(node_id);
|
||||
}
|
||||
None => {
|
||||
dirty_nodes.insert(node_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3764,3 +3764,37 @@ def test_storage_controller_node_flap_detach_race(
|
||||
assert len(locs) == 1, f"{shard} has {len(locs)} attached locations"
|
||||
|
||||
wait_until(validate_locations, timeout=10)
|
||||
|
||||
|
||||
def test_storage_controller_config_equivalence(neon_env_builder: NeonEnvBuilder):
|
||||
neon_env_builder.num_pageservers = 1
|
||||
neon_env_builder.storage_controller_config = {
|
||||
"start_as_candidate": False,
|
||||
}
|
||||
|
||||
env = neon_env_builder.init_configs()
|
||||
env.start()
|
||||
|
||||
tenant_id = TenantId.generate()
|
||||
env.storage_controller.tenant_create(
|
||||
tenant_id, shard_count=2, tenant_config={"pitr_interval": "1h2m3s"}
|
||||
)
|
||||
|
||||
env.storage_controller.reconcile_until_idle()
|
||||
|
||||
reconciles_before_restart = env.storage_controller.get_metric_value(
|
||||
"storage_controller_reconcile_complete_total", filter={"status": "ok"}
|
||||
)
|
||||
|
||||
assert reconciles_before_restart != 0
|
||||
|
||||
env.storage_controller.stop()
|
||||
env.storage_controller.start()
|
||||
|
||||
env.storage_controller.reconcile_until_idle()
|
||||
|
||||
reconciles_after_restart = env.storage_controller.get_metric_value(
|
||||
"storage_controller_reconcile_complete_total", filter={"status": "ok"}
|
||||
)
|
||||
|
||||
assert reconciles_after_restart == 0
|
||||
|
||||
Reference in New Issue
Block a user