From 8abb8382f139bccdd82c0806b063387a710c0b42 Mon Sep 17 00:00:00 2001 From: Anton Myagkov Date: Thu, 14 Nov 2024 16:16:03 +0000 Subject: [PATCH] filestore: remove endpoint if path is not found --- cloud/filestore/libs/daemon/vhost/bootstrap.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cloud/filestore/libs/daemon/vhost/bootstrap.cpp b/cloud/filestore/libs/daemon/vhost/bootstrap.cpp index f4585f105b..60988e7765 100644 --- a/cloud/filestore/libs/daemon/vhost/bootstrap.cpp +++ b/cloud/filestore/libs/daemon/vhost/bootstrap.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include @@ -460,9 +461,19 @@ void TBootstrapVhost::RestoreKeyringEndpoints() future.Subscribe([=] (const auto& f) { const auto& response = f.GetValue(); if (HasError(response)) { + const auto& error = response.GetError(); // TODO: report critical error - STORAGE_ERROR("Failed to start endpoint: " - << FormatError(response.GetError())); + STORAGE_ERROR( + "Failed to start endpoint: " << FormatError(error)); + if (response.GetError().GetCode() == + MAKE_SCHEMESHARD_ERROR( + NKikimrScheme::EStatus::StatusPathDoesNotExist)) + { + STORAGE_INFO( + "Remove endpoint for non-existing volume. endpoint id: " + << keyringId.Quote()); + EndpointStorage->RemoveEndpoint(keyringId); + } } }); }