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


##########
be/src/io/cache/block_file_cache.cpp:
##########
@@ -950,6 +927,26 @@ FileBlocks BlockFileCache::split_range_into_cells(const 
UInt128Wrapper& hash,
                                                   std::lock_guard<std::mutex>& 
cache_lock) {
     DCHECK(size > 0);
 
+    CacheContext block_context = context;
+    if (auto file_iter = _files.find(hash);
+        file_iter != _files.end() && !file_iter->second.empty()) {
+        const auto& first_block = file_iter->second.begin()->second.file_block;
+        auto existing_cache_type = first_block->cache_type();
+        if (context.cache_type == FileCacheType::TTL || existing_cache_type == 
FileCacheType::TTL) {
+            block_context.cache_type = existing_cache_type;

Review Comment:
   [P2] Refresh cache metadata for stale rowsets too
   
   `CloudTablet::sync_meta()` applies a new creation-time/TTL only to keys in 
`_rs_version_map`, but `capture_rs_readers_unlocked()` deliberately falls back 
to `_stale_rs_version_map` and those readers calculate the new tablet 
expiration. Once this line makes the first cached block authoritative, a 
partially cached stale rowset never receives that explicit update: existing 
blocks and holes filled later keep the obsolete policy—NORMAL after TTL is 
enabled, TTL until its old expiration after TTL is disabled, or the previous 
positive expiration instead of the new one. Please update segment/index keys in 
both current and stale rowset maps when tablet TTL metadata changes, and cover 
a stale-rowset read/hole across zero and positive TTL transitions.



##########
be/src/io/cache/block_file_cache.cpp:
##########
@@ -950,6 +927,26 @@ FileBlocks BlockFileCache::split_range_into_cells(const 
UInt128Wrapper& hash,
                                                   std::lock_guard<std::mutex>& 
cache_lock) {
     DCHECK(size > 0);
 
+    CacheContext block_context = context;
+    if (auto file_iter = _files.find(hash);
+        file_iter != _files.end() && !file_iter->second.empty()) {
+        const auto& first_block = file_iter->second.begin()->second.file_block;
+        auto existing_cache_type = first_block->cache_type();
+        if (context.cache_type == FileCacheType::TTL || existing_cache_type == 
FileCacheType::TTL) {
+            block_context.cache_type = existing_cache_type;
+            block_context.expiration_time = first_block->expiration_time();

Review Comment:
   [P2] Revalidate in-flight cache producers after TTL changes
   
   Warmups and rowset writers snapshot the tablet expiration before they create 
cache keys. If `sync_meta()` changes TTL first, its explicit update is a no-op 
for an absent hash (and cannot visit an unpublished writer rowset), so 
old-generation work can later insert the first block with the obsolete 
NORMAL/TTL policy. This line makes that expiration authoritative for later 
reads and holes, while unchanged metadata syncs do not retry. Please 
generation-fence in-flight producers or reconcile keys on 
insertion/publication, and test delayed warmup and load/compaction writers 
across zero and positive TTL transitions.



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