From 7b612da871fc976bbb2b052a08ab7a3a53e5a109 Mon Sep 17 00:00:00 2001 From: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com> Date: Mon, 16 Jan 2023 14:21:09 +0100 Subject: [PATCH] Update AsynchronousReadIndirectBufferFromRemoteFS.cpp --- .../IO/AsynchronousReadIndirectBufferFromRemoteFS.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Disks/IO/AsynchronousReadIndirectBufferFromRemoteFS.cpp b/src/Disks/IO/AsynchronousReadIndirectBufferFromRemoteFS.cpp index 0e50b064471..7e325aac8f7 100644 --- a/src/Disks/IO/AsynchronousReadIndirectBufferFromRemoteFS.cpp +++ b/src/Disks/IO/AsynchronousReadIndirectBufferFromRemoteFS.cpp @@ -164,7 +164,8 @@ bool AsynchronousReadIndirectBufferFromRemoteFS::nextImpl() if (!hasPendingDataToRead()) return false; - assert(file_offset_of_buffer_end <= impl->getFileSize()); + chassert(file_offset_of_buffer_end <= impl->getFileSize()); + chassert(file_offset_of_buffer_end >= impl->getImplementationBufferOffset()); Stopwatch watch; CurrentMetrics::Increment metric_increment{CurrentMetrics::AsynchronousReadWait}; @@ -226,8 +227,8 @@ bool AsynchronousReadIndirectBufferFromRemoteFS::nextImpl() /// In case of multiple files for the same file in clickhouse (i.e. log family) /// file_offset_of_buffer_end will not match getImplementationBufferOffset() /// so we use [impl->getImplementationBufferOffset(), impl->getFileSize()] - assert(file_offset_of_buffer_end >= impl->getImplementationBufferOffset()); - assert(file_offset_of_buffer_end <= impl->getFileSize()); + chassert(file_offset_of_buffer_end >= impl->getImplementationBufferOffset()); + chassert(file_offset_of_buffer_end <= impl->getFileSize()); prefetch_future = {}; return bytes_read;