This is an automated email from the ASF dual-hosted git repository.

hellostephen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new b1585e1736d [fix](filecache) correct ttl metrics (#60252)
b1585e1736d is described below

commit b1585e1736ddceaa3695ed29751c9c5f69847f5e
Author: zhengyu <[email protected]>
AuthorDate: Tue Feb 3 17:00:35 2026 +0800

    [fix](filecache) correct ttl metrics (#60252)
    
    add changing type to Normal when TTL type & TTL set to 0 to make ttl
    queueu size correct
---
 be/src/io/cache/block_file_cache_ttl_mgr.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/be/src/io/cache/block_file_cache_ttl_mgr.cpp 
b/be/src/io/cache/block_file_cache_ttl_mgr.cpp
index 082ac9623ff..d1406d08325 100644
--- a/be/src/io/cache/block_file_cache_ttl_mgr.cpp
+++ b/be/src/io/cache/block_file_cache_ttl_mgr.cpp
@@ -180,6 +180,7 @@ void 
BlockFileCacheTtlMgr::run_backgroud_update_ttl_info_map() {
                 }
 
                 // Update TTL info map
+                bool need_convert_from_ttl = false;
                 {
                     std::lock_guard<std::mutex> lock(_ttl_info_mutex);
                     if (ttl > 0) {
@@ -204,6 +205,19 @@ void 
BlockFileCacheTtlMgr::run_backgroud_update_ttl_info_map() {
                     } else {
                         // Remove from TTL map if TTL is 0
                         _ttl_info_map.erase(tablet_id);
+                        need_convert_from_ttl = true;
+                    }
+                }
+
+                if (need_convert_from_ttl) {
+                    FileBlocks blocks = 
get_file_blocks_from_tablet_id(tablet_id);
+                    for (auto& block : blocks) {
+                        if (block->cache_type() == FileCacheType::TTL) {
+                            auto st = 
block->change_cache_type(FileCacheType::NORMAL);
+                            if (!st.ok()) {
+                                LOG(WARNING) << "Failed to convert block back 
to NORMAL cache_type";
+                            }
+                        }
                     }
                 }
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to