From dc599e990c96e645d1e5083be381d8286872cce4 Mon Sep 17 00:00:00 2001 From: Kanthi Subramanian Date: Tue, 8 Sep 2026 19:10:29 +0200 Subject: [PATCH] Add 409 to the non-retriable HTTP Error list --- src/Databases/DataLake/RestCatalog.cpp | 7 +++++++ src/IO/HTTPCommon.cpp | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Databases/DataLake/RestCatalog.cpp b/src/Databases/DataLake/RestCatalog.cpp index 9750c3de6dbf..a77da1a751d3 100644 --- a/src/Databases/DataLake/RestCatalog.cpp +++ b/src/Databases/DataLake/RestCatalog.cpp @@ -1725,6 +1725,13 @@ void RestCatalog::createNamespaceIfNotExists(const String & namespace_name, cons auto timer = DB::CurrentThread::getProfileEvents().timer(ProfileEvents::DataLakeRestCatalogCreateNamespaceMicroseconds); sendRequest(endpoint, request_body); } + catch (const DB::HTTPException & e) + { + if (e.getHTTPStatus() == Poco::Net::HTTPResponse::HTTP_CONFLICT) + LOG_DEBUG(log, "Namespace {} already exists", namespace_name); + else + DB::tryLogCurrentException(log); + } catch (...) { DB::tryLogCurrentException(log); diff --git a/src/IO/HTTPCommon.cpp b/src/IO/HTTPCommon.cpp index 3bd91cb9950c..14d7fd8d4db0 100644 --- a/src/IO/HTTPCommon.cpp +++ b/src/IO/HTTPCommon.cpp @@ -70,7 +70,8 @@ bool isRetriableHTTPError(const Poco::Net::HTTPResponse::HTTPStatus http_status) Poco::Net::HTTPResponse::HTTPStatus::HTTP_NOT_FOUND, Poco::Net::HTTPResponse::HTTPStatus::HTTP_FORBIDDEN, Poco::Net::HTTPResponse::HTTPStatus::HTTP_NOT_IMPLEMENTED, - Poco::Net::HTTPResponse::HTTPStatus::HTTP_METHOD_NOT_ALLOWED}; + Poco::Net::HTTPResponse::HTTPStatus::HTTP_METHOD_NOT_ALLOWED, + Poco::Net::HTTPResponse::HTTPStatus::HTTP_CONFLICT}; return std::all_of( non_retriable_errors.begin(), non_retriable_errors.end(), [&](const auto status) { return http_status != status; });