From c563a25f145009c0b391bc3dddbda0f291b71252 Mon Sep 17 00:00:00 2001 From: Erik Grinaker Date: Thu, 17 Oct 2024 10:35:03 +0200 Subject: [PATCH] compute_tools: disable fast path for safekeeper sync --- compute_tools/src/compute.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compute_tools/src/compute.rs b/compute_tools/src/compute.rs index 285be56264..f434ac23e4 100644 --- a/compute_tools/src/compute.rs +++ b/compute_tools/src/compute.rs @@ -526,6 +526,10 @@ impl ComputeNode { // Fast path for sync_safekeepers. If they're already synced we get the lsn // in one roundtrip. If not, we should do a full sync_safekeepers. + // + // NB: currently unused, see: https://github.com/neondatabase/neon/issues/9259. Consider + // removing this, or improving it e.g. by using a different protocol, bumping the safekeeper + // term, or flushing the Safekeeper WAL on STATUS_TIMELINE. pub fn check_safekeepers_synced(&self, compute_state: &ComputeState) -> Result> { let start_time = Utc::now(); @@ -629,14 +633,10 @@ impl ComputeNode { // cannot sync safekeepers. let lsn = match spec.mode { ComputeMode::Primary => { - info!("checking if safekeepers are synced"); - let lsn = if let Ok(Some(lsn)) = self.check_safekeepers_synced(compute_state) { - lsn - } else { - info!("starting safekeepers syncing"); - self.sync_safekeepers(pspec.storage_auth_token.clone()) - .with_context(|| "failed to sync safekeepers")? - }; + info!("starting safekeepers syncing"); + let lsn = self + .sync_safekeepers(pspec.storage_auth_token.clone()) + .with_context(|| "failed to sync safekeepers")?; info!("safekeepers synced at LSN {}", lsn); lsn }