freemandealer commented on code in PR #40226: URL: https://github.com/apache/doris/pull/40226#discussion_r1741379390
########## be/src/io/cache/file_block.cpp: ########## @@ -161,32 +161,27 @@ Status FileBlock::read(Slice buffer, size_t read_offset) { return _mgr->_storage->read(_key, read_offset, buffer); } -Status FileBlock::change_cache_type_by_mgr(FileCacheType new_type) { +Status FileBlock::change_cache_type_between_ttl_and_others(FileCacheType new_type) { std::lock_guard block_lock(_mutex); DCHECK(new_type != _key.meta.type); - if (_download_state == State::DOWNLOADED) { - KeyMeta new_meta; - new_meta.expiration_time = _key.meta.expiration_time; - new_meta.type = new_type; - auto st = _mgr->_storage->change_key_meta(_key, new_meta); - TEST_SYNC_POINT_CALLBACK("FileBlock::change_cache_type", &st); - if (!st.ok()) return st; - } + DCHECK(new_type == FileCacheType::TTL || _key.meta.type == FileCacheType::TTL); Review Comment: On a second thought, I should add a warning for provide more info in release version. -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org