mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Fix unit test, add check
This commit is contained in:
parent
0023bf69cb
commit
b8a4a784de
@ -412,6 +412,14 @@ void CacheMetadata::downloadImpl(FileSegment & file_segment, std::optional<Memor
|
||||
|
||||
auto reader = file_segment.getRemoteFileReader();
|
||||
|
||||
if (!reader)
|
||||
{
|
||||
throw Exception(
|
||||
ErrorCodes::LOGICAL_ERROR, "No reader. "
|
||||
"File segment should not have been submitted for background download ({})",
|
||||
file_segment.getInfoForLog());
|
||||
}
|
||||
|
||||
/// If remote_fs_read_method == 'threadpool',
|
||||
/// reader itself never owns/allocates the buffer.
|
||||
if (reader->internalBuffer().empty())
|
||||
|
@ -533,8 +533,8 @@ TEST_F(FileCacheTest, get)
|
||||
cv.notify_one();
|
||||
|
||||
file_segment2.wait(file_segment2.range().left);
|
||||
ASSERT_TRUE(file_segment2.state() == DB::FileSegment::State::PARTIALLY_DOWNLOADED);
|
||||
ASSERT_TRUE(file_segment2.getOrSetDownloader() == DB::FileSegment::getCallerId());
|
||||
ASSERT_EQ(file_segment2.state(), DB::FileSegment::State::EMPTY);
|
||||
ASSERT_EQ(file_segment2.getOrSetDownloader(), DB::FileSegment::getCallerId());
|
||||
download(file_segment2);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user