gavinchou commented on code in PR #63504:
URL: https://github.com/apache/doris/pull/63504#discussion_r3356938035


##########
be/src/io/cache/block_file_cache.cpp:
##########
@@ -138,11 +160,101 @@ size_t NeedUpdateLRUBlocks::shard_index(FileBlock* ptr) 
const {
     return std::hash<FileBlock*> {}(ptr)&kShardMask;
 }
 
+bool NeedUpdateLRUBlocks::try_reserve_slot() {
+    size_t cur_size = _size.load(std::memory_order_relaxed);
+    while (cur_size < _hard_cap) {
+        if (_size.compare_exchange_weak(cur_size, cur_size + 1, 
std::memory_order_relaxed,
+                                        std::memory_order_relaxed)) {
+            return true;
+        }
+    }
+    return false;
+}
+
+namespace {
+
+struct QueueConsumePlan {
+    int64_t interval_ms = 0;
+    size_t batch_limit = 0;
+};
+
+constexpr size_t kLruLogReplayAdaptiveLowWatermark = 50'000;
+constexpr size_t kLruLogReplayAdaptiveHighWatermark = 300'000;
+constexpr int64_t kLruLogReplayAdaptiveMinIntervalMs = 100;
+constexpr size_t kLruLogReplayAdaptiveMaxBatchPerType = 25'000;
+
+constexpr size_t kBlockLruUpdateAdaptiveLowWatermark = 10'000;
+constexpr size_t kBlockLruUpdateAdaptiveHighWatermark = 50'000;
+constexpr int64_t kBlockLruUpdateAdaptiveMinIntervalMs = 500;
+constexpr size_t kBlockLruUpdateAdaptiveMaxBatch = 10'000;
+constexpr size_t kBlockLruUpdateLockSliceBatch = 500;
+constexpr size_t kNeedUpdateLruBlocksHardCap = 100'000;
+constexpr size_t kLruRecorderLogQueueHardCap = 500'000;

Review Comment:
   kLruRecorderLogQueueHardCap should be configurable. 
   i dont think the plan thing is still need, just consume in full speed 



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