Merge pull request #61266 from ClickHouse/fix-disk-web-exists

Fix `01417_freeze_partition_verbose`
This commit is contained in:
Kseniia Sumarokova 2024-03-13 10:44:20 +01:00 committed by GitHub
commit 992465f6ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -86,6 +86,10 @@ WebObjectStorage::loadFiles(const String & path, const std::unique_lock<std::sha
loaded_files.emplace_back(file_path);
}
/// Check for not found url after read attempt, because of delayed initialization.
if (metadata_buf->hasNotFoundURL())
return {};
auto [it, inserted] = files.add(path, FileData::createDirectoryInfo(true));
if (!inserted)
{

View File

@ -449,6 +449,7 @@ bool ReadWriteBufferFromHTTP::nextImpl()
if (http_skip_not_found_url && e.getHTTPStatus() == Poco::Net::HTTPResponse::HTTPStatus::HTTP_NOT_FOUND)
{
next_result = false;
has_not_found_url = true;
return;
}
@ -740,4 +741,3 @@ ReadWriteBufferFromHTTP::HTTPFileInfo ReadWriteBufferFromHTTP::parseFileInfo(con
}
}

View File

@ -79,6 +79,7 @@ private:
const bool use_external_buffer;
const bool http_skip_not_found_url;
bool has_not_found_url = false;
std::function<void(std::ostream &)> out_stream_callback;
@ -183,6 +184,8 @@ public:
std::optional<time_t> tryGetLastModificationTime();
bool hasNotFoundURL() const { return has_not_found_url; }
HTTPFileInfo getFileInfo();
static HTTPFileInfo parseFileInfo(const Poco::Net::HTTPResponse & response, size_t requested_range_begin);
};