diff --git a/src/Databases/DataLake/RestCatalog.cpp b/src/Databases/DataLake/RestCatalog.cpp index 43d85d2e61a23..ac657fe46125c 100644 --- a/src/Databases/DataLake/RestCatalog.cpp +++ b/src/Databases/DataLake/RestCatalog.cpp @@ -1167,6 +1167,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/ReadWriteBufferFromHTTP.cpp b/src/IO/ReadWriteBufferFromHTTP.cpp index 02834987d5387..29d108ac9ca21 100644 --- a/src/IO/ReadWriteBufferFromHTTP.cpp +++ b/src/IO/ReadWriteBufferFromHTTP.cpp @@ -28,7 +28,8 @@ bool isRetriableError(const Poco::Net::HTTPResponse::HTTPStatus http_status) noe 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; });