From 8c1dee30a9c931f123424e0e1ae8ec14d3022989 Mon Sep 17 00:00:00 2001 From: kssenii Date: Wed, 13 Nov 2024 17:46:02 +0100 Subject: [PATCH] Fix assert --- src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp b/src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp index 5b6a32c6714..a8422d94a16 100644 --- a/src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp +++ b/src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp @@ -399,6 +399,15 @@ CachedOnDiskReadBufferFromFile::ReadFromFileSegmentStatePtr CachedOnDiskReadBuff auto downloader_id = file_segment.getOrSetDownloader(); if (downloader_id == FileSegment::getCallerId()) { + SCOPE_EXIT( + { + if (result->read_type != ReadType::REMOTE_FS_READ_AND_PUT_IN_CACHE + && file_segment.isDownloader()) + { + file_segment.resetDownloader(); + } + }); + if (canStartFromCache(offset, file_segment)) { /// segment{k}