This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new ad3ae7c9640 branch-3.0: [fix](cache) Add conf
`segment_cache_enable_prune` #52513 (#52641)
ad3ae7c9640 is described below
commit ad3ae7c96405d60f79949e1119a585082f806acd
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jul 7 14:34:57 2025 +0800
branch-3.0: [fix](cache) Add conf `segment_cache_enable_prune` #52513
(#52641)
Cherry-picked from #52513
Co-authored-by: Xinyi Zou <[email protected]>
---
be/src/common/config.cpp | 1 +
be/src/common/config.h | 2 ++
be/src/olap/segment_loader.h | 3 ++-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index dc81ca48373..9f14823e975 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1192,6 +1192,7 @@ DEFINE_Int32(segment_cache_capacity, "-1");
DEFINE_Int32(segment_cache_fd_percentage, "20");
DEFINE_mInt32(estimated_mem_per_column_reader, "512");
DEFINE_Int32(segment_cache_memory_percentage, "5");
+DEFINE_Bool(enable_segment_cache_prune, "true");
// enable feature binlog, default false
DEFINE_Bool(enable_feature_binlog, "false");
diff --git a/be/src/common/config.h b/be/src/common/config.h
index a1820494725..34fee6cabed 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1231,6 +1231,8 @@ DECLARE_mInt32(schema_cache_sweep_time_sec);
DECLARE_Int32(segment_cache_capacity);
DECLARE_Int32(segment_cache_fd_percentage);
DECLARE_Int32(segment_cache_memory_percentage);
+DECLARE_Bool(enable_segment_cache_prune);
+
DECLARE_mInt32(estimated_mem_per_column_reader);
// enable binlog
diff --git a/be/src/olap/segment_loader.h b/be/src/olap/segment_loader.h
index 2c5b1ed200d..792e66fdd7f 100644
--- a/be/src/olap/segment_loader.h
+++ b/be/src/olap/segment_loader.h
@@ -83,7 +83,8 @@ public:
SegmentCache(size_t memory_bytes_limit, size_t segment_num_limit)
: LRUCachePolicy(CachePolicy::CacheType::SEGMENT_CACHE,
memory_bytes_limit,
LRUCacheType::SIZE,
config::tablet_rowset_stale_sweep_time_sec,
- DEFAULT_LRU_CACHE_NUM_SHARDS * 2,
segment_num_limit) {}
+ DEFAULT_LRU_CACHE_NUM_SHARDS * 2,
segment_num_limit,
+ config::enable_segment_cache_prune) {}
// Lookup the given segment in the cache.
// If the segment is found, the cache entry will be written into handle.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]