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


##########
be/src/cloud/cloud_tablet.cpp:
##########
@@ -688,6 +689,8 @@ void CloudTablet::remove_unused_rowsets() {
     int64_t removed_delete_bitmap_num = 0;
     OlapStopWatch watch;
     {
+        // Warmup callbacks use _meta_lock; take it before _gc_mutex, as 
add_rowsets does.
+        std::unique_lock meta_lock(_meta_lock);

Review Comment:
   [P2] Clear unused rowset caches after releasing the metadata lock
   
   After a large compaction, the vacuum thread can reclaim many cached input 
segments in one pass. This new exclusive `_meta_lock` stays held while 
`rs->clear_cache()` clears every rowset in that batch; that function reaches 
`BlockFileCache::remove_if_cached_async()`, which synchronously walks/removes 
cache metadata for every block despite its name. `capture_rs_readers()`, rowset 
synchronization and warmup callbacks all need `_meta_lock`, so they now wait 
for the entire cache-cleanup batch. Please keep the protected state 
removal/selection here, then clear the selected rowsets' caches after releasing 
`_meta_lock` and `_gc_mutex`; `removed_rowsets` already keeps them alive.



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