gavinchou commented on code in PR #54363:
URL: https://github.com/apache/doris/pull/54363#discussion_r2257321308


##########
be/src/io/cache/block_file_cache_downloader.cpp:
##########
@@ -265,10 +265,12 @@ void 
FileCacheBlockDownloader::download_segment_file(const DownloadFileMeta& met
 
     std::unique_ptr<char[]> buffer(new char[one_single_task_size]);
 
+    size_t task_offset = 0;
     for (size_t i = 0; i < task_num; i++) {
-        size_t offset = meta.offset + i * one_single_task_size;
-        size_t size =
-                std::min(one_single_task_size, 
static_cast<size_t>(meta.download_size - offset));
+        size_t offset = meta.offset + task_offset;

Review Comment:
   add unit test for this function using syncpoint to construct  meta and 
reader (use local FS & filereader instead)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to