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; });