From e2fa9961363d4bdc5501c338bedb42cf9472eedb Mon Sep 17 00:00:00 2001 From: "Andrew J. Stone" Date: Mon, 13 Nov 2023 14:14:00 -0500 Subject: [PATCH] Ignore AlreadyInitialized errors during cold boot (#4486) Ignore `bootstore::ApiError::AlreadyInitialized` errors when attempting to start the sled-agent as a learner. We will always get this during cold boot because the learner state has been persisted to the ledger. Fixes https://github.com/oxidecomputer/omicron/issues/4485 --- sled-agent/src/bootstrap/server.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sled-agent/src/bootstrap/server.rs b/sled-agent/src/bootstrap/server.rs index e57e8318e4..e0ea85860b 100644 --- a/sled-agent/src/bootstrap/server.rs +++ b/sled-agent/src/bootstrap/server.rs @@ -452,7 +452,15 @@ async fn start_sled_agent( if request.body.use_trust_quorum && request.body.is_lrtq_learner { info!(log, "Initializing sled as learner"); - bootstore.init_learner().await?; + match bootstore.init_learner().await { + Err(bootstore::NodeRequestError::Fsm( + bootstore::ApiError::AlreadyInitialized, + )) => { + // This is a cold boot. Let's ignore this error and continue. + } + Err(e) => return Err(e.into()), + Ok(()) => (), + } } // Inform the storage service that the key manager is available