From 7243c1d0ce2a3688c73e63255d8f2ce27eb69ead Mon Sep 17 00:00:00 2001 From: Buqian Zheng Date: Wed, 28 May 2025 10:30:28 +0800 Subject: [PATCH] feat: remove async warmup policy (#42123) issue: https://github.com/milvus-io/milvus/issues/41993 Signed-off-by: Buqian Zheng --- configs/milvus.yaml | 5 ++--- internal/core/src/cachinglayer/CacheSlot.h | 16 +--------------- internal/core/src/common/type_c.h | 1 - internal/util/segcore/segment.go | 2 -- pkg/util/paramtable/component_param.go | 5 ++--- 5 files changed, 5 insertions(+), 24 deletions(-) diff --git a/configs/milvus.yaml b/configs/milvus.yaml index 0b1d8d6081..b7db571627 100644 --- a/configs/milvus.yaml +++ b/configs/milvus.yaml @@ -437,10 +437,9 @@ queryNode: multipleChunkedEnable: true # Deprecated. Enable multiple chunked search tieredStorage: warmup: - # options: sync, async, disable. + # options: sync, disable. # Specifies the timing for warming up the Tiered Storage cache. # - "sync": data will be loaded into the cache before a segment is considered loaded. - # - "async": data will be loaded asynchronously into the cache after a segment is loaded. # - "disable": data will not be proactively loaded into the cache, and loaded only if needed by search/query tasks. # Defaults to "sync", except for vector field which defaults to "disable". scalarField: sync @@ -459,7 +458,7 @@ queryNode: diskHighWatermarkRatio: 0.8 diskMaxRatio: 0.9 # Enable eviction for Tiered Storage. Defaults to false. - # Note that if eviction is enabled, cache data loaded during sync/async warmup is also subject to eviction. + # Note that if eviction is enabled, cache data loaded during sync warmup is also subject to eviction. evictionEnabled: false knowhereScoreConsistency: false # Enable knowhere strong consistency score computation logic jsonKeyStatsCommitInterval: 200 # the commit interval for the JSON key Stats to commit diff --git a/internal/core/src/cachinglayer/CacheSlot.h b/internal/core/src/cachinglayer/CacheSlot.h index 73697cf2a0..edbd018d48 100644 --- a/internal/core/src/cachinglayer/CacheSlot.h +++ b/internal/core/src/cachinglayer/CacheSlot.h @@ -86,21 +86,7 @@ class CacheSlot final : public std::enable_shared_from_this> { for (cid_t i = 0; i < translator_->num_cells(); ++i) { cids.push_back(i); } - - switch (warmup_policy) { - case CacheWarmupPolicy::CacheWarmupPolicy_Sync: - SemiInlineGet(PinCells(std::move(cids))); - break; - case CacheWarmupPolicy::CacheWarmupPolicy_Async: - // PinCells submits tasks to middle priority thread pool, thus here we submit to - // low priority thread pool to avoid dead lock. - auto& pool = milvus::ThreadPools::GetThreadPool( - milvus::ThreadPoolPriority::LOW); - pool.Submit([this, cids = std::move(cids)]() mutable { - SemiInlineGet(PinCells(std::move(cids))); - }); - break; - } + SemiInlineGet(PinCells(std::move(cids))); } folly::SemiFuture>> diff --git a/internal/core/src/common/type_c.h b/internal/core/src/common/type_c.h index 7d2b720164..ee29674c26 100644 --- a/internal/core/src/common/type_c.h +++ b/internal/core/src/common/type_c.h @@ -35,7 +35,6 @@ typedef enum SegmentType SegmentType; enum CacheWarmupPolicy { CacheWarmupPolicy_Disable = 0, CacheWarmupPolicy_Sync = 1, - CacheWarmupPolicy_Async = 2, }; typedef enum CacheWarmupPolicy CacheWarmupPolicy; diff --git a/internal/util/segcore/segment.go b/internal/util/segcore/segment.go index aa2c81299f..82d04575cf 100644 --- a/internal/util/segcore/segment.go +++ b/internal/util/segcore/segment.go @@ -300,8 +300,6 @@ func ConvertCacheWarmupPolicy(policy string) (C.CacheWarmupPolicy, error) { switch policy { case "sync": return C.CacheWarmupPolicy_Sync, nil - case "async": - return C.CacheWarmupPolicy_Async, nil case "disable": return C.CacheWarmupPolicy_Disable, nil default: diff --git a/pkg/util/paramtable/component_param.go b/pkg/util/paramtable/component_param.go index 3552acf93c..532ec5a664 100644 --- a/pkg/util/paramtable/component_param.go +++ b/pkg/util/paramtable/component_param.go @@ -2928,10 +2928,9 @@ func (p *queryNodeConfig) init(base *BaseTable) { Key: "queryNode.segcore.tieredStorage.warmup.scalarField", Version: "2.6.0", DefaultValue: "sync", - Doc: `options: sync, async, disable. + Doc: `options: sync, disable. Specifies the timing for warming up the Tiered Storage cache. - "sync": data will be loaded into the cache before a segment is considered loaded. -- "async": data will be loaded asynchronously into the cache after a segment is loaded. - "disable": data will not be proactively loaded into the cache, and loaded only if needed by search/query tasks. Defaults to "sync", except for vector field which defaults to "disable".`, Export: true, @@ -2968,7 +2967,7 @@ Defaults to "sync", except for vector field which defaults to "disable".`, Version: "2.6.0", DefaultValue: "false", Doc: `Enable eviction for Tiered Storage. Defaults to false. -Note that if eviction is enabled, cache data loaded during sync/async warmup is also subject to eviction.`, +Note that if eviction is enabled, cache data loaded during sync warmup is also subject to eviction.`, Export: true, } p.TieredEvictionEnabled.Init(base.mgr)