fix: Fix inaccurate partition num metric (#37996)

The partition number has already been incremented in
`ChangePartitionState`, so there is no need to increment it again in
`AddPartition`.

issue: https://github.com/milvus-io/milvus/issues/37630

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
yihao.dai 2024-12-03 21:24:40 +08:00 committed by GitHub
parent e359725530
commit db2ed2c044
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -905,8 +905,6 @@ func (mt *MetaTable) AddPartition(ctx context.Context, partition *model.Partitio
mt.generalCnt += int(coll.ShardsNum) // 1 partition * shardNum mt.generalCnt += int(coll.ShardsNum) // 1 partition * shardNum
metrics.RootCoordNumOfPartitions.WithLabelValues().Inc()
log.Ctx(ctx).Info("add partition to meta table", log.Ctx(ctx).Info("add partition to meta table",
zap.Int64("collection", partition.CollectionID), zap.String("partition", partition.PartitionName), zap.Int64("collection", partition.CollectionID), zap.String("partition", partition.PartitionName),
zap.Int64("partitionid", partition.PartitionID), zap.Uint64("ts", partition.PartitionCreatedTimestamp)) zap.Int64("partitionid", partition.PartitionID), zap.Uint64("ts", partition.PartitionCreatedTimestamp))