mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 18:02:24 +00:00
Update FileCache.cpp
This commit is contained in:
parent
6f6434d50d
commit
57d9697e21
@ -1023,7 +1023,7 @@ void FileCache::loadMetadataForKeys(const fs::path & keys_dir)
|
||||
|
||||
if (limits_satisfied)
|
||||
{
|
||||
KeyMetadata::iterator file_segment_metadata_it;
|
||||
bool inserted = false;
|
||||
try
|
||||
{
|
||||
auto file_segment = std::make_shared<FileSegment>(key, offset, size,
|
||||
@ -1033,21 +1033,20 @@ void FileCache::loadMetadataForKeys(const fs::path & keys_dir)
|
||||
key_metadata,
|
||||
cache_it);
|
||||
|
||||
auto [_, inserted] = key_metadata->emplace(offset, std::make_shared<FileSegmentMetadata>(std::move(file_segment)));
|
||||
if (!inserted)
|
||||
{
|
||||
cache_it->remove(lockCache());
|
||||
chassert(false);
|
||||
}
|
||||
inserted = key_metadata->emplace(offset, std::make_shared<FileSegmentMetadata>(std::move(file_segment))).second;
|
||||
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||
chassert(false);
|
||||
}
|
||||
|
||||
if (!inserted)
|
||||
{
|
||||
cache_it->remove(lockCache());
|
||||
fs::remove(offset_it->path());
|
||||
continue;
|
||||
chassert(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user