From 587f829eb8e509be02b924c48708e0f58a014cc4 Mon Sep 17 00:00:00 2001 From: Nikita Taranov Date: Sun, 17 Dec 2023 18:37:07 +0100 Subject: [PATCH] Always use `pread` for reading cache segments --- src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp b/src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp index b90547cfd38..f507fb207e5 100644 --- a/src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp +++ b/src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp @@ -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);