gavinchou commented on code in PR #40226:
URL: https://github.com/apache/doris/pull/40226#discussion_r1741000809
##########
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:
can we return error instead of DCHECK?
--
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]