Skip to content

Commit

Permalink
sqld: temp fix replica namespace doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
LucioFranco committed Oct 3, 2024
1 parent 0916848 commit a86d3c1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions libsql-server/src/namespace/configurator/replica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand Down

0 comments on commit a86d3c1

Please sign in to comment.