From ce73db93162f7e2975f05d3fe90658042c39fb7c Mon Sep 17 00:00:00 2001 From: Anastasia Lubennikova Date: Tue, 1 Oct 2024 16:28:58 +0100 Subject: [PATCH] Fix post_apply_config() (#9220) Bring back post_apply_config() step that was accidentally removed in 78938d1 --- compute_tools/src/compute.rs | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/compute_tools/src/compute.rs b/compute_tools/src/compute.rs index 147eb2a161..2f6e2bdb2c 100644 --- a/compute_tools/src/compute.rs +++ b/compute_tools/src/compute.rs @@ -1060,19 +1060,26 @@ impl ComputeNode { let pg_process = self.start_postgres(pspec.storage_auth_token.clone())?; let config_time = Utc::now(); - if pspec.spec.mode == ComputeMode::Primary && !pspec.spec.skip_pg_catalog_updates { - let pgdata_path = Path::new(&self.pgdata); - // temporarily reset max_cluster_size in config - // to avoid the possibility of hitting the limit, while we are applying config: - // creating new extensions, roles, etc... - config::with_compute_ctl_tmp_override(pgdata_path, "neon.max_cluster_size=-1", || { + if pspec.spec.mode == ComputeMode::Primary { + if !pspec.spec.skip_pg_catalog_updates { + let pgdata_path = Path::new(&self.pgdata); + // temporarily reset max_cluster_size in config + // to avoid the possibility of hitting the limit, while we are applying config: + // creating new extensions, roles, etc... + config::with_compute_ctl_tmp_override( + pgdata_path, + "neon.max_cluster_size=-1", + || { + self.pg_reload_conf()?; + + self.apply_config(&compute_state)?; + + Ok(()) + }, + )?; self.pg_reload_conf()?; - - self.apply_config(&compute_state)?; - - Ok(()) - })?; - self.pg_reload_conf()?; + } + self.post_apply_config()?; } let startup_end_time = Utc::now();