From a86d3c107454e1762abda20c2bcebd25c35723de Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Thu, 3 Oct 2024 14:51:27 -0400 Subject: [PATCH] sqld: temp fix replica namespace doesnt exist --- .../src/namespace/configurator/replica.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libsql-server/src/namespace/configurator/replica.rs b/libsql-server/src/namespace/configurator/replica.rs index b4b67a027d..2fb9b79997 100644 --- a/libsql-server/src/namespace/configurator/replica.rs +++ b/libsql-server/src/namespace/configurator/replica.rs @@ -123,10 +123,17 @@ impl ConfigureNamespace for ReplicaConfigurator { loop { match replicator.run().await { err @ Error::Fatal(_) => Err(err)?, - err @ Error::NamespaceDoesntExist => { - tracing::error!("namespace {namespace} doesn't exist, destroying..."); - (reset)(ResetOp::Destroy(namespace.clone())); - Err(err)?; + _err @ Error::NamespaceDoesntExist => { + // TODO(lucio): there is a bug where a primary will report that a valid + // namespace doesn't exist when it does and causes the replicate to + // destroy the namespace locally. For now the temp solution is to + // ignore this error (still log it) and don't destroy the local + // namespace data on the replica. This trades off storage space for + // returing 500s. + tracing::error!("namespace {namespace} doesn't exist, trying to replicate again..."); + // tracing::error!("namespace {namespace} doesn't exist, destroying..."); + // (reset)(ResetOp::Destroy(namespace.clone())); + // Err(err)?; } e @ Error::Injector(_) => { tracing::error!("potential corruption detected while replicating, reseting replica: {e}");