From e4123a9a5c186b5cd751866d7e5a324669428bf6 Mon Sep 17 00:00:00 2001 From: Sean Klein Date: Mon, 1 Jul 2024 16:29:07 -0700 Subject: [PATCH] Add TODO, re: concurrency safety --- sled-agent/src/sled_agent.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sled-agent/src/sled_agent.rs b/sled-agent/src/sled_agent.rs index dc8cf942e0..b7cc5b5be3 100644 --- a/sled-agent/src/sled_agent.rs +++ b/sled-agent/src/sled_agent.rs @@ -820,6 +820,17 @@ impl SledAgent { config: OmicronPhysicalDisksConfig, ) -> Result { // First, tell the storage subsystem which disks should be managed. + // + // TODO: Do we want to prevent future calls to + // "omicron_physical_disks_ensure" until we finish flushing? + // + // Otherwise, we the following could occur: + // + // - Ensure Disks {A, B, C} + // - ... try to remove all non-conforming disks + // - Ensure Disks {A, B, C, D} concurrently + // - ... we remove an instance on disk "D" because the old flush is + // still happening? let disk_result = self.storage().omicron_physical_disks_ensure(config).await?;