github-actions[bot] commented on code in PR #63410:
URL: https://github.com/apache/doris/pull/63410#discussion_r3332707051


##########
be/src/io/cache/file_block.cpp:
##########
@@ -163,8 +163,7 @@ Status FileBlock::finalize() {
     if (_downloaded_size != _block_range.size()) {
         SCOPED_CACHE_LOCK(_mgr->_mutex, _mgr);
         size_t old_size = _block_range.size();
-        _block_range.right = _block_range.left + _downloaded_size - 1;
-        size_t new_size = _block_range.size();
+        size_t new_size = _downloaded_size;
         DCHECK(new_size < old_size);

Review Comment:
   `reset_range` is now the single place that updates the `FileBlock` range and 
its comment says it can reset, not only shrink. This finalize path can 
therefore see `new_size > old_size`: `FSFileCacheStorage::init()` starts async 
loading, `load_cache_info_into_memory_from_fs()` calls 
`handle_already_loaded_block()` even for `*_tmp` files, and with this PR that 
can shrink an in-memory DOWNLOADING block's `_block_range` to the partial 
tmp-file size before the downloader reaches `finalize()`. The downloader then 
has `_downloaded_size` equal to the completed block size, so the following 
`DCHECK(new_size < old_size)` aborts ASAN/debug builds even though growing the 
range is now a valid recovery step. Please relax/remove that shrink-only 
DCHECK, or prevent tmp-file async loading from resetting active downloading 
blocks.



-- 
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