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


##########
be/src/io/cache/block_file_cache.cpp:
##########
@@ -2086,15 +2373,8 @@ void BlockFileCache::run_background_gc() {
             }
         }
 
-        while (batch_count < batch_limit && _recycle_keys.try_dequeue(key)) {
-            int64_t duration_ns = 0;
-            Status st;
-            {
-                SCOPED_RAW_TIMER(&duration_ns);
-                st = _storage->remove(key);
-            }
-            *_storage_async_remove_latency_us << (duration_ns / 1000);
-
+        while (batch_count < batch_limit && try_dequeue_recycle_key(&key)) {
+            Status st = remove_dequeued_recycle_key(key, false);
             if (!st.ok()) {

Review Comment:
   `clear_file_cache_sync()` now waits for metadata delete fences only for 
recycle keys drained through `drain_recycle_keys()`, but the normal background 
GC can still dequeue from the same `_recycle_keys` queue while sync clear is 
running and this call uses `wait_meta_delete_fence=false`. In that 
interleaving, a block marked by sync clear is released, its holder enqueues the 
key, `run_background_gc()` removes the file and enqueues the RocksDB meta 
delete asynchronously, then decrements `_recycle_remove_inflight`; 
`clear_file_cache_sync()` can observe `recycle_keys_idle()` and return before 
the meta-store worker processes that delete. That breaks the new sync-clear 
contract and is not covered by the added meta-fence test because the test only 
exercises the clear thread consuming the key. Please either make background GC 
skip/drain with fences while `_clear_file_cache_sync_running` is active, or 
include background-GC-owned async meta deletes in the sync clear idle/fence 
condition.



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