freemandealer commented on code in PR #54363:
URL: https://github.com/apache/doris/pull/54363#discussion_r2257558528
##########
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;
+
+ size_t size = std::min(one_single_task_size,
+ static_cast<size_t>(meta.download_size -
task_offset));
Review Comment:
download_size should not exist ... 这里 download_size 如果是 0 就应该不下载。如果 0
不符合预期,应该去找上游的问题,而不是按全部文件大小去全部下载。特别是 offset != 0 时还按照文件大小下载逻辑上更不对了
--
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]