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


##########
be/src/io/cache/block_file_cache_ttl_mgr.cpp:
##########
@@ -238,9 +244,10 @@ 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;
+                        // Periodically reconcile blocks restored from 
persisted TTL metadata,
+                        // because _ttl_info_map is rebuilt only in memory 
after restart.
+                        need_convert_from_ttl =

Review Comment:
   This reconcile still misses the restart case described in the comment. The 
update loop only iterates `tablet_ids_to_process`, which is copied from 
`_tablet_id_set`; however startup restore from RocksDB goes through 
`FSFileCacheStorage::load_cache_info_into_memory_from_db()` -> 
`mgr->add_cell(...)`, and `BlockFileCache::add_cell()` does not call 
`register_tablet_id` (the registration in this area only happens when 
`split_range_into_cells()` creates new request cells). After a BE restart, a 
persisted TTL block for a tablet whose current TTL is now 0 can therefore be 
loaded into the TTL queue without its tablet ID ever entering `_tablet_id_set`, 
so the 20-round reconcile will never scan or demote it unless a later cache 
miss happens to register the same tablet. The new test manually calls 
`register_tablet_id`, so it does not cover that production restore path. Please 
register restored/direct-loaded tablet IDs with the TTL manager or initialize 
the manager from the meta store, and add
  a restart-style test that does not manually register the tablet.



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