From c14cc0be68633a7067549b87d0ff3f93b1a4a287 Mon Sep 17 00:00:00 2001 From: Roshan Jobanputra Date: Thu, 21 Mar 2024 11:47:38 -0400 Subject: [PATCH] storage: fix dyncfg implementation --- src/storage-controller/src/lib.rs | 4 ++-- src/storage/src/storage_state.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/storage-controller/src/lib.rs b/src/storage-controller/src/lib.rs index 27d2907c1f6b2..a1456957f7b6e 100644 --- a/src/storage-controller/src/lib.rs +++ b/src/storage-controller/src/lib.rs @@ -261,10 +261,10 @@ where } } - fn update_parameters(&mut self, mut config_params: StorageParameters) { + fn update_parameters(&mut self, config_params: StorageParameters) { // We serialize the dyncfg updates in StorageParameters, but configure // persist separately. - if let Some(updates) = config_params.dyncfg_updates.take() { + if let Some(updates) = &config_params.dyncfg_updates { updates.apply(self.persist.cfg()); } diff --git a/src/storage/src/storage_state.rs b/src/storage/src/storage_state.rs index ab585d11c4109..585e7e9d53d4a 100644 --- a/src/storage/src/storage_state.rs +++ b/src/storage/src/storage_state.rs @@ -1196,13 +1196,13 @@ impl StorageState { match cmd { StorageCommand::CreateTimely { .. } => panic!("CreateTimely must be captured before"), StorageCommand::InitializationComplete => (), - StorageCommand::UpdateConfiguration(mut params) => { + StorageCommand::UpdateConfiguration(params) => { // These can be done from all workers safely. tracing::info!("Applying configuration update: {params:?}"); // We serialize the dyncfg updates in StorageParameters, but configure // persist separately. - if let Some(updates) = params.dyncfg_updates.take() { + if let Some(updates) = ¶ms.dyncfg_updates { updates.apply(self.persist_clients.cfg()); }