freemandealer commented on code in PR #64381:
URL: https://github.com/apache/doris/pull/64381#discussion_r3389339674


##########
be/src/io/cache/lru_queue_recorder.cpp:
##########
@@ -17,27 +17,53 @@
 
 #include "io/cache/lru_queue_recorder.h"
 
+#include "common/check.h"
+#include "common/config.h"
 #include "io/cache/block_file_cache.h"
 #include "io/cache/file_cache_common.h"
 
 namespace doris::io {
 
+namespace {
+
+size_t file_cache_type_index(FileCacheType type) {
+    return static_cast<size_t>(type);
+}
+
+} // namespace
+
 void LRUQueueRecorder::record_queue_event(FileCacheType type, CacheLRULogType 
log_type,
                                           const UInt128Wrapper hash, const 
size_t offset,
                                           const size_t size) {
-    CacheLRULogQueue& log_queue = get_lru_log_queue(type);
-    log_queue.enqueue(std::make_unique<CacheLRULog>(log_type, hash, offset, 
size));
+    if (config::file_cache_background_lru_dump_tail_record_num <= 0) {
+        return;
+    }
     ++(_lru_queue_update_cnt_from_last_dump[type]);
+    auto log = std::make_unique<CacheLRULog>(log_type, hash, offset, size);
+    if (!reserve_lru_log_queue_slot(type)) {
+        return;

Review Comment:
   The invalid shadow queue dump will be cured automatically. So this won't be 
a serious problem.



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