mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
enhance: tiered index updates (#44433)
issue: #42032 #44212 - special case for warmup param and cell storage size for tiered index - add a config to enable/disable storage usage tracking --------- Signed-off-by: chasingegg <chao.gao@zilliz.com>
This commit is contained in:
parent
75557f3eb8
commit
539f17f1ad
@ -509,6 +509,7 @@ queryNode:
|
|||||||
# If a cached data hasn't been accessed again after this time since its last access, it will be evicted.
|
# If a cached data hasn't been accessed again after this time since its last access, it will be evicted.
|
||||||
# If set to 0, time based eviction is disabled.
|
# If set to 0, time based eviction is disabled.
|
||||||
cacheTtl: 0
|
cacheTtl: 0
|
||||||
|
storageUsageTrackingEnabled: false # Enable storage usage tracking for Tiered Storage. Defaults to false.
|
||||||
knowhereScoreConsistency: false # Enable knowhere strong consistency score computation logic
|
knowhereScoreConsistency: false # Enable knowhere strong consistency score computation logic
|
||||||
deleteDumpBatchSize: 10000 # Batch size for delete snapshot dump in segcore.
|
deleteDumpBatchSize: 10000 # Batch size for delete snapshot dump in segcore.
|
||||||
loadMemoryUsageFactor: 1 # The multiply factor of calculating the memory usage while loading segments
|
loadMemoryUsageFactor: 1 # The multiply factor of calculating the memory usage while loading segments
|
||||||
|
|||||||
@ -195,6 +195,7 @@ ConfigureTieredStorage(const CacheWarmupPolicy scalarFieldCacheWarmupPolicy,
|
|||||||
const int64_t disk_low_watermark_bytes,
|
const int64_t disk_low_watermark_bytes,
|
||||||
const int64_t disk_high_watermark_bytes,
|
const int64_t disk_high_watermark_bytes,
|
||||||
const int64_t disk_max_bytes,
|
const int64_t disk_max_bytes,
|
||||||
|
const bool storage_usage_tracking_enabled,
|
||||||
const bool eviction_enabled,
|
const bool eviction_enabled,
|
||||||
const int64_t cache_touch_window_ms,
|
const int64_t cache_touch_window_ms,
|
||||||
const bool background_eviction_enabled,
|
const bool background_eviction_enabled,
|
||||||
@ -216,6 +217,7 @@ ConfigureTieredStorage(const CacheWarmupPolicy scalarFieldCacheWarmupPolicy,
|
|||||||
disk_low_watermark_bytes,
|
disk_low_watermark_bytes,
|
||||||
disk_high_watermark_bytes,
|
disk_high_watermark_bytes,
|
||||||
disk_max_bytes},
|
disk_max_bytes},
|
||||||
|
storage_usage_tracking_enabled,
|
||||||
eviction_enabled,
|
eviction_enabled,
|
||||||
{cache_touch_window_ms,
|
{cache_touch_window_ms,
|
||||||
background_eviction_enabled,
|
background_eviction_enabled,
|
||||||
|
|||||||
@ -106,6 +106,8 @@ ConfigureTieredStorage(
|
|||||||
const int64_t disk_low_watermark_bytes,
|
const int64_t disk_low_watermark_bytes,
|
||||||
const int64_t disk_high_watermark_bytes,
|
const int64_t disk_high_watermark_bytes,
|
||||||
const int64_t disk_max_bytes,
|
const int64_t disk_max_bytes,
|
||||||
|
// storage usage tracking enabled
|
||||||
|
const bool storage_usage_tracking_enabled,
|
||||||
// eviction enabled
|
// eviction enabled
|
||||||
const bool eviction_enabled,
|
const bool eviction_enabled,
|
||||||
// eviction configs
|
// eviction configs
|
||||||
|
|||||||
@ -39,9 +39,17 @@ SealedIndexTranslator::SealedIndexTranslator(
|
|||||||
milvus::segcore::getCellDataType(
|
milvus::segcore::getCellDataType(
|
||||||
/* is_vector */ IsVectorDataType(load_index_info->field_type),
|
/* is_vector */ IsVectorDataType(load_index_info->field_type),
|
||||||
/* is_index */ true),
|
/* is_index */ true),
|
||||||
milvus::segcore::getCacheWarmupPolicy(
|
// if index data supports lazy load internally, we always use sync for index metadata
|
||||||
/* is_vector */ IsVectorDataType(load_index_info->field_type),
|
// warmup policy will be used for index internally
|
||||||
/* is_index */ true),
|
// currently only vector index is possible to support lazy load
|
||||||
|
(IsVectorDataType(load_index_info->field_type) &&
|
||||||
|
knowhere::IndexFactory::Instance().FeatureCheck(
|
||||||
|
index_info_.index_type, knowhere::feature::LAZY_LOAD))
|
||||||
|
? CacheWarmupPolicy::CacheWarmupPolicy_Sync
|
||||||
|
: milvus::segcore::getCacheWarmupPolicy(
|
||||||
|
/* is_vector */ IsVectorDataType(
|
||||||
|
load_index_info->field_type),
|
||||||
|
/* is_index */ true),
|
||||||
/* support_eviction */
|
/* support_eviction */
|
||||||
// if index data supports lazy load internally, we don't need to support eviction for index metadata
|
// if index data supports lazy load internally, we don't need to support eviction for index metadata
|
||||||
// currently only vector index is possible to support lazy load
|
// currently only vector index is possible to support lazy load
|
||||||
|
|||||||
@ -44,6 +44,13 @@ class SealedIndexTranslator
|
|||||||
int64_t
|
int64_t
|
||||||
cells_storage_bytes(
|
cells_storage_bytes(
|
||||||
const std::vector<milvus::cachinglayer::cid_t>& cids) const override {
|
const std::vector<milvus::cachinglayer::cid_t>& cids) const override {
|
||||||
|
// if index data supports lazy load internally, cell storage size becomes 0
|
||||||
|
// currently only vector index is possible to support lazy load
|
||||||
|
if (IsVectorDataType(index_load_info_.field_type) &&
|
||||||
|
knowhere::IndexFactory::Instance().FeatureCheck(
|
||||||
|
index_info_.index_type, knowhere::feature::LAZY_LOAD)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
constexpr int64_t MIN_STORAGE_BYTES = 1 * 1024 * 1024;
|
constexpr int64_t MIN_STORAGE_BYTES = 1 * 1024 * 1024;
|
||||||
return std::max(index_load_info_.index_size, MIN_STORAGE_BYTES);
|
return std::max(index_load_info_.index_size, MIN_STORAGE_BYTES);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
milvus_add_pkg_config("milvus-common")
|
milvus_add_pkg_config("milvus-common")
|
||||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES "")
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES "")
|
||||||
set( MILVUS-COMMON-VERSION 4767d68 )
|
set( MILVUS-COMMON-VERSION 3ab63a9 )
|
||||||
set( GIT_REPOSITORY "https://github.com/zilliztech/milvus-common.git")
|
set( GIT_REPOSITORY "https://github.com/zilliztech/milvus-common.git")
|
||||||
|
|
||||||
message(STATUS "milvus-common repo: ${GIT_REPOSITORY}")
|
message(STATUS "milvus-common repo: ${GIT_REPOSITORY}")
|
||||||
|
|||||||
@ -38,6 +38,7 @@ main(int argc, char** argv) {
|
|||||||
CacheWarmupPolicy::CacheWarmupPolicy_Disable},
|
CacheWarmupPolicy::CacheWarmupPolicy_Disable},
|
||||||
{1024 * mb, 1024 * mb, 1024 * mb, 1024 * mb, 1024 * mb, 1024 * mb},
|
{1024 * mb, 1024 * mb, 1024 * mb, 1024 * mb, 1024 * mb, 1024 * mb},
|
||||||
true,
|
true,
|
||||||
|
true,
|
||||||
{10, true, 30});
|
{10, true, 30});
|
||||||
|
|
||||||
return RUN_ALL_TESTS();
|
return RUN_ALL_TESTS();
|
||||||
|
|||||||
@ -351,6 +351,7 @@ func InitTieredStorage(params *paramtable.ComponentParam) error {
|
|||||||
diskHighWatermarkBytes := C.int64_t(diskHighWatermarkRatio * float64(osDiskBytes))
|
diskHighWatermarkBytes := C.int64_t(diskHighWatermarkRatio * float64(osDiskBytes))
|
||||||
diskMaxBytes := C.int64_t(diskMaxRatio * float64(osDiskBytes))
|
diskMaxBytes := C.int64_t(diskMaxRatio * float64(osDiskBytes))
|
||||||
|
|
||||||
|
storageUsageTrackingEnabled := C.bool(params.QueryNodeCfg.StorageUsageTrackingEnabled.GetAsBool())
|
||||||
evictionEnabled := C.bool(params.QueryNodeCfg.TieredEvictionEnabled.GetAsBool())
|
evictionEnabled := C.bool(params.QueryNodeCfg.TieredEvictionEnabled.GetAsBool())
|
||||||
cacheTouchWindowMs := C.int64_t(params.QueryNodeCfg.TieredCacheTouchWindowMs.GetAsInt64())
|
cacheTouchWindowMs := C.int64_t(params.QueryNodeCfg.TieredCacheTouchWindowMs.GetAsInt64())
|
||||||
backgroundEvictionEnabled := C.bool(params.QueryNodeCfg.TieredBackgroundEvictionEnabled.GetAsBool())
|
backgroundEvictionEnabled := C.bool(params.QueryNodeCfg.TieredBackgroundEvictionEnabled.GetAsBool())
|
||||||
@ -368,6 +369,7 @@ func InitTieredStorage(params *paramtable.ComponentParam) error {
|
|||||||
vectorIndexCacheWarmupPolicy,
|
vectorIndexCacheWarmupPolicy,
|
||||||
memoryLowWatermarkBytes, memoryHighWatermarkBytes, memoryMaxBytes,
|
memoryLowWatermarkBytes, memoryHighWatermarkBytes, memoryMaxBytes,
|
||||||
diskLowWatermarkBytes, diskHighWatermarkBytes, diskMaxBytes,
|
diskLowWatermarkBytes, diskHighWatermarkBytes, diskMaxBytes,
|
||||||
|
storageUsageTrackingEnabled,
|
||||||
evictionEnabled, cacheTouchWindowMs,
|
evictionEnabled, cacheTouchWindowMs,
|
||||||
backgroundEvictionEnabled, evictionIntervalMs, cacheCellUnaccessedSurvivalTime,
|
backgroundEvictionEnabled, evictionIntervalMs, cacheCellUnaccessedSurvivalTime,
|
||||||
overloadedMemoryThresholdPercentage, loadingResourceFactor, maxDiskUsagePercentage, diskPath)
|
overloadedMemoryThresholdPercentage, loadingResourceFactor, maxDiskUsagePercentage, diskPath)
|
||||||
|
|||||||
@ -3057,6 +3057,7 @@ type queryNodeConfig struct {
|
|||||||
TieredEvictionIntervalMs ParamItem `refreshable:"false"`
|
TieredEvictionIntervalMs ParamItem `refreshable:"false"`
|
||||||
CacheCellUnaccessedSurvivalTime ParamItem `refreshable:"false"`
|
CacheCellUnaccessedSurvivalTime ParamItem `refreshable:"false"`
|
||||||
TieredLoadingResourceFactor ParamItem `refreshable:"false"`
|
TieredLoadingResourceFactor ParamItem `refreshable:"false"`
|
||||||
|
StorageUsageTrackingEnabled ParamItem `refreshable:"false"`
|
||||||
|
|
||||||
KnowhereScoreConsistency ParamItem `refreshable:"false"`
|
KnowhereScoreConsistency ParamItem `refreshable:"false"`
|
||||||
|
|
||||||
@ -3441,6 +3442,15 @@ If set to 0, time based eviction is disabled.`,
|
|||||||
}
|
}
|
||||||
p.CacheCellUnaccessedSurvivalTime.Init(base.mgr)
|
p.CacheCellUnaccessedSurvivalTime.Init(base.mgr)
|
||||||
|
|
||||||
|
p.StorageUsageTrackingEnabled = ParamItem{
|
||||||
|
Key: "queryNode.segcore.tieredStorage.storageUsageTrackingEnabled",
|
||||||
|
Version: "2.6.3",
|
||||||
|
DefaultValue: "false",
|
||||||
|
Doc: "Enable storage usage tracking for Tiered Storage. Defaults to false.",
|
||||||
|
Export: true,
|
||||||
|
}
|
||||||
|
p.StorageUsageTrackingEnabled.Init(base.mgr)
|
||||||
|
|
||||||
p.TieredLoadingResourceFactor = ParamItem{
|
p.TieredLoadingResourceFactor = ParamItem{
|
||||||
Key: "queryNode.segcore.tieredStorage.loadingResourceFactor",
|
Key: "queryNode.segcore.tieredStorage.loadingResourceFactor",
|
||||||
Version: "2.6.0",
|
Version: "2.6.0",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user