mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 03:52:15 +00:00
Fix tests
This commit is contained in:
parent
4556b516d7
commit
9bb283f050
@ -92,12 +92,16 @@ void FileCache::initialize()
|
||||
{
|
||||
std::lock_guard lock(init_mutex);
|
||||
|
||||
if (is_initialized)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
loadMetadata();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||
init_exception = std::current_exception();
|
||||
throw;
|
||||
}
|
||||
@ -1246,12 +1250,13 @@ std::vector<String> FileCache::tryGetCachePaths(const Key & key)
|
||||
{
|
||||
assertInitialized();
|
||||
|
||||
std::lock_guard lock(files_mutex);
|
||||
auto key_transaction = createKeyTransaction(key, KeyNotFoundPolicy::RETURN_NULL);
|
||||
if (!key_transaction)
|
||||
return {};
|
||||
|
||||
const auto & cells_by_offset = *files[key];
|
||||
std::vector<String> cache_paths;
|
||||
|
||||
for (const auto & [offset, cell] : cells_by_offset)
|
||||
for (const auto & [offset, cell] : key_transaction->getOffsets())
|
||||
{
|
||||
if (cell.file_segment->state() == FileSegment::State::DOWNLOADED)
|
||||
cache_paths.push_back(getPathInLocalCache(key, offset, cell.file_segment->getKind()));
|
||||
|
Loading…
Reference in New Issue
Block a user