diff --git a/internal/querycoordv2/checkers/index_checker.go b/internal/querycoordv2/checkers/index_checker.go index 3e19f7db85..f4eb8a8b6a 100644 --- a/internal/querycoordv2/checkers/index_checker.go +++ b/internal/querycoordv2/checkers/index_checker.go @@ -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{}{}