diff --git a/control_plane/src/local_env.rs b/control_plane/src/local_env.rs
index d7830a5e70..505d157efd 100644
--- a/control_plane/src/local_env.rs
+++ b/control_plane/src/local_env.rs
@@ -514,7 +514,6 @@ impl LocalEnv {
#[derive(serde::Serialize, serde::Deserialize)]
// (allow unknown fields, unlike PageServerConf)
struct PageserverConfigTomlSubset {
- id: NodeId,
listen_pg_addr: String,
listen_http_addr: String,
pg_auth_type: AuthType,
@@ -526,18 +525,30 @@ impl LocalEnv {
.with_context(|| format!("read {:?}", config_toml_path))?,
)
.context("parse pageserver.toml")?;
+ let identity_toml_path = dentry.path().join("identity.toml");
+ #[derive(serde::Serialize, serde::Deserialize)]
+ struct IdentityTomlSubset {
+ id: NodeId,
+ }
+ let identity_toml: IdentityTomlSubset = toml_edit::de::from_str(
+ &std::fs::read_to_string(&identity_toml_path)
+ .with_context(|| format!("read {:?}", identity_toml_path))?,
+ )
+ .context("parse identity.toml")?;
let PageserverConfigTomlSubset {
- id: config_toml_id,
listen_pg_addr,
listen_http_addr,
pg_auth_type,
http_auth_type,
} = config_toml;
+ let IdentityTomlSubset {
+ id: identity_toml_id,
+ } = identity_toml;
let conf = PageServerConf {
id: {
anyhow::ensure!(
- config_toml_id == id,
- "id mismatch: config_toml.id={config_toml_id} id={id}",
+ identity_toml_id == id,
+ "id mismatch: identity.toml:id={identity_toml_id} pageserver_(.*) id={id}",
);
id
},
diff --git a/control_plane/src/pageserver.rs b/control_plane/src/pageserver.rs
index ba4f98d945..399b1c2653 100644
--- a/control_plane/src/pageserver.rs
+++ b/control_plane/src/pageserver.rs
@@ -127,10 +127,13 @@ impl PageServerNode {
}
// Apply the user-provided overrides
- overrides.push(
- toml_edit::ser::to_string_pretty(&conf)
- .expect("we deserialized this from toml earlier"),
- );
+ overrides.push({
+ let mut doc =
+ toml_edit::ser::to_document(&conf).expect("we deserialized this from toml earlier");
+ // `id` is written out to `identity.toml` instead of `pageserver.toml`
+ doc.remove("id").expect("it's part of the struct");
+ doc.to_string()
+ });
// Turn `overrides` into a toml document.
// TODO: above code is legacy code, it should be refactored to use toml_edit directly.
diff --git a/pageserver/src/config.rs b/pageserver/src/config.rs
index 100c6c1ac5..f71881683d 100644
--- a/pageserver/src/config.rs
+++ b/pageserver/src/config.rs
@@ -356,8 +356,6 @@ struct PageServerConfigBuilder {
auth_validation_public_key_path: BuilderValue