fix: fix indexchecker schema released (#40809)

pr:https://github.com/milvus-io/milvus/pull/38039
issue:https://github.com/milvus-io/milvus/issues/36995

Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
This commit is contained in:
Xianhui Lin 2025-03-20 18:05:22 +08:00 committed by GitHub
parent 5ca2af8124
commit 8bdff401a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,10 +97,6 @@ func (c *IndexChecker) Check(ctx context.Context) []task.Task {
log.Warn("collection released during check index", zap.Int64("collection", collectionID))
continue
}
if schema == nil {
log.Warn("schema released during check index", zap.Int64("collection", collectionID))
continue
}
replicas := c.meta.ReplicaManager.GetByCollection(ctx, collectionID)
for _, replica := range replicas {
tasks = append(tasks, c.checkReplica(ctx, collection, replica, indexInfos, schema)...)
@ -240,8 +236,11 @@ func (c *IndexChecker) createSegmentUpdateTask(ctx context.Context, segment *met
func (c *IndexChecker) checkSegmentStats(segment *meta.Segment, schema *schemapb.CollectionSchema, loadField []int64) (missFieldIDs []int64) {
var result []int64
if paramtable.Get().CommonCfg.EnabledJSONKeyStats.GetAsBool() {
if schema == nil {
log.Warn("schema released during check checkSegmentStats", zap.Int64("collection", segment.GetCollectionID()))
return result
}
loadFieldMap := make(map[int64]struct{})
for _, v := range loadField {
loadFieldMap[v] = struct{}{}