enhance: disable reload partstats by config (#32702)

Signed-off-by: MrPresent-Han <chun.han@zilliz.com>
pull/32044/head
Chun Han 2024-04-29 19:11:26 +08:00 committed by GitHub
parent 0359139299
commit ac82cef04d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -873,6 +873,8 @@ func NewShardDelegator(ctx context.Context, collectionID UniqueID, replicaID Uni
go sd.watchTSafe()
}
log.Info("finish build new shardDelegator")
sd.maybeReloadPartitionStats(ctx)
if paramtable.Get().QueryNodeCfg.EnableSegmentPrune.GetAsBool() {
sd.maybeReloadPartitionStats(ctx)
}
return sd, nil
}

View File

@ -504,7 +504,9 @@ func (sd *shardDelegator) LoadSegments(ctx context.Context, req *querypb.LoadSeg
lo.ForEach(req.GetInfos(), func(info *querypb.SegmentLoadInfo, _ int) {
partStatsToReload = append(partStatsToReload, info.PartitionID)
})
sd.maybeReloadPartitionStats(ctx, partStatsToReload...)
if paramtable.Get().QueryNodeCfg.EnableSegmentPrune.GetAsBool() {
sd.maybeReloadPartitionStats(ctx, partStatsToReload...)
}
return nil
}
@ -906,7 +908,9 @@ func (sd *shardDelegator) ReleaseSegments(ctx context.Context, req *querypb.Rele
partitionsToReload = append(partitionsToReload, segment.Partition())
}
})
sd.maybeReloadPartitionStats(ctx, partitionsToReload...)
if paramtable.Get().QueryNodeCfg.EnableSegmentPrune.GetAsBool() {
sd.maybeReloadPartitionStats(ctx, partitionsToReload...)
}
return nil
}