Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Databases/DataLake/RestCatalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/IO/HTTPCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; });
Expand Down
Loading