mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge pull request #57970 from ClickHouse/nickitat-patch-17
Always use `pread` for reading cache segments
This commit is contained in:
commit
dbd509417e
@ -177,22 +177,13 @@ CachedOnDiskReadBufferFromFile::getCacheReadBuffer(const FileSegment & file_segm
|
||||
}
|
||||
|
||||
ReadSettings local_read_settings{settings};
|
||||
local_read_settings.local_fs_prefetch = false;
|
||||
if (local_read_settings.local_fs_method != LocalFSReadMethod::pread_threadpool)
|
||||
local_read_settings.local_fs_method = LocalFSReadMethod::pread;
|
||||
local_read_settings.local_fs_method = LocalFSReadMethod::pread;
|
||||
|
||||
if (use_external_buffer)
|
||||
local_read_settings.local_fs_buffer_size = 0;
|
||||
|
||||
cache_file_reader = createReadBufferFromFileBase(
|
||||
path,
|
||||
local_read_settings,
|
||||
std::nullopt,
|
||||
std::nullopt,
|
||||
file_segment.getFlagsForLocalRead(),
|
||||
/*existing_memory=*/nullptr,
|
||||
/*alignment=*/0,
|
||||
/*use_external_buffer=*/true);
|
||||
cache_file_reader
|
||||
= createReadBufferFromFileBase(path, local_read_settings, std::nullopt, std::nullopt, file_segment.getFlagsForLocalRead());
|
||||
|
||||
if (getFileSizeFromReadBuffer(*cache_file_reader) == 0)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Attempt to read from an empty cache file: {}", path);
|
||||
|
Loading…
Reference in New Issue
Block a user