mirror of https://github.com/milvus-io/milvus.git
Cherry-pick from master pr: #32805 Related to #32803 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/32839/head
parent
49b760f8ea
commit
311d66ca02
|
@ -19,7 +19,6 @@ package pipeline
|
|||
import (
|
||||
"github.com/milvus-io/milvus/internal/querynodev2/delegator"
|
||||
base "github.com/milvus-io/milvus/internal/util/pipeline"
|
||||
"github.com/milvus-io/milvus/pkg/metrics"
|
||||
"github.com/milvus-io/milvus/pkg/mq/msgdispatcher"
|
||||
"github.com/milvus-io/milvus/pkg/util/paramtable"
|
||||
)
|
||||
|
@ -37,7 +36,6 @@ type pipeline struct {
|
|||
|
||||
func (p *pipeline) Close() {
|
||||
p.StreamPipeline.Close()
|
||||
metrics.CleanupQueryNodeCollectionMetrics(paramtable.GetNodeID(), p.collectionID)
|
||||
}
|
||||
|
||||
func NewPipeLine(
|
||||
|
|
|
@ -25,7 +25,6 @@ package segments
|
|||
import "C"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"unsafe"
|
||||
|
||||
|
@ -119,16 +118,8 @@ func (m *collectionManager) Unref(collectionID int64, count uint32) bool {
|
|||
log.Info("release collection due to ref count to 0", zap.Int64("collectionID", collectionID))
|
||||
delete(m.collections, collectionID)
|
||||
DeleteCollection(collection)
|
||||
metrics.QueryNodeEntitiesSize.DeleteLabelValues(
|
||||
fmt.Sprint(paramtable.GetNodeID()),
|
||||
fmt.Sprint(collectionID),
|
||||
SegmentTypeSealed.String(),
|
||||
)
|
||||
metrics.QueryNodeEntitiesSize.DeleteLabelValues(
|
||||
fmt.Sprint(paramtable.GetNodeID()),
|
||||
fmt.Sprint(collectionID),
|
||||
SegmentTypeGrowing.String(),
|
||||
)
|
||||
|
||||
metrics.CleanupQueryNodeCollectionMetrics(paramtable.GetNodeID(), collectionID)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
|
@ -756,27 +756,31 @@ func RegisterQueryNode(registry *prometheus.Registry) {
|
|||
}
|
||||
|
||||
func CleanupQueryNodeCollectionMetrics(nodeID int64, collectionID int64) {
|
||||
for _, label := range []string{DeleteLabel, InsertLabel} {
|
||||
QueryNodeConsumerMsgCount.
|
||||
Delete(
|
||||
prometheus.Labels{
|
||||
nodeIDLabelName: fmt.Sprint(nodeID),
|
||||
msgTypeLabelName: label,
|
||||
collectionIDLabelName: fmt.Sprint(collectionID),
|
||||
})
|
||||
nodeIDLabel := fmt.Sprint(nodeID)
|
||||
collectionIDLabel := fmt.Sprint(collectionID)
|
||||
QueryNodeConsumerMsgCount.
|
||||
DeletePartialMatch(
|
||||
prometheus.Labels{
|
||||
nodeIDLabelName: nodeIDLabel,
|
||||
collectionIDLabelName: collectionIDLabel,
|
||||
})
|
||||
|
||||
QueryNodeConsumeTimeTickLag.
|
||||
Delete(
|
||||
prometheus.Labels{
|
||||
nodeIDLabelName: fmt.Sprint(nodeID),
|
||||
msgTypeLabelName: label,
|
||||
collectionIDLabelName: fmt.Sprint(collectionID),
|
||||
})
|
||||
QueryNodeNumEntities.
|
||||
DeletePartialMatch(
|
||||
prometheus.Labels{
|
||||
nodeIDLabelName: fmt.Sprint(nodeID),
|
||||
collectionIDLabelName: fmt.Sprint(collectionID),
|
||||
})
|
||||
}
|
||||
QueryNodeConsumeTimeTickLag.
|
||||
DeletePartialMatch(
|
||||
prometheus.Labels{
|
||||
nodeIDLabelName: nodeIDLabel,
|
||||
collectionIDLabelName: collectionIDLabel,
|
||||
})
|
||||
QueryNodeNumEntities.
|
||||
DeletePartialMatch(
|
||||
prometheus.Labels{
|
||||
nodeIDLabelName: nodeIDLabel,
|
||||
collectionIDLabelName: collectionIDLabel,
|
||||
})
|
||||
QueryNodeEntitiesSize.
|
||||
DeletePartialMatch(
|
||||
prometheus.Labels{
|
||||
nodeIDLabelName: nodeIDLabel,
|
||||
collectionIDLabelName: collectionIDLabel,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue