diff --git a/internal/indexnode/task_stats.go b/internal/indexnode/task_stats.go index 5868c3aa7738d..4bba6c0ff48f2 100644 --- a/internal/indexnode/task_stats.go +++ b/internal/indexnode/task_stats.go @@ -381,6 +381,7 @@ func (st *statsTask) downloadData(ctx context.Context, numRows int64, PKFieldID break } else { log.Warn("downloadData wrong, failed to iter through data", zap.Error(err)) + iter.Close() return nil, err } } @@ -399,6 +400,7 @@ func (st *statsTask) downloadData(ctx context.Context, numRows int64, PKFieldID values = append(values, iter.Value()) remainingRowCount++ } + iter.Close() } log.Info("download data success",