gavinchou commented on code in PR #40226: URL: https://github.com/apache/doris/pull/40226#discussion_r1741003334
########## 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); + + // change cache type between TTL to others don't need to rename the filename suffix _key.meta.type = new_type; return Status::OK(); } -Status FileBlock::change_cache_type_self(FileCacheType new_type) { +Status FileBlock::change_cache_type_between_normal_and_index(FileCacheType new_type) { std::lock_guard cache_lock(_mgr->_mutex); std::lock_guard block_lock(_mutex); + DCHECK(new_type != FileCacheType::TTL && _key.meta.type != FileCacheType::TTL); if (_key.meta.type == FileCacheType::TTL || new_type == _key.meta.type) { return Status::OK(); Review Comment: ditto -- 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