mirror of https://github.com/milvus-io/milvus.git
Fix a panic issue while reporting metrics (#20776)
issue: #20771 /kind bug Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com> Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>pull/20813/head
parent
81d0056e83
commit
3cde5b53ad
|
@ -585,17 +585,18 @@ func (m *meta) UpdateDropChannelSegmentInfo(channel string, segments []*SegmentI
|
||||||
|
|
||||||
// mergeDropSegment merges drop segment information with meta segments
|
// mergeDropSegment merges drop segment information with meta segments
|
||||||
func (m *meta) mergeDropSegment(seg2Drop *SegmentInfo) (*SegmentInfo, *segMetricMutation) {
|
func (m *meta) mergeDropSegment(seg2Drop *SegmentInfo) (*SegmentInfo, *segMetricMutation) {
|
||||||
|
metricMutation := &segMetricMutation{
|
||||||
|
stateChange: make(map[string]int),
|
||||||
|
}
|
||||||
|
|
||||||
segment := m.segments.GetSegment(seg2Drop.ID)
|
segment := m.segments.GetSegment(seg2Drop.ID)
|
||||||
// healthy check makes sure the Idempotence
|
// healthy check makes sure the Idempotence
|
||||||
if segment == nil || !isSegmentHealthy(segment) {
|
if segment == nil || !isSegmentHealthy(segment) {
|
||||||
log.Warn("UpdateDropChannel skipping nil or unhealthy", zap.Bool("is nil", segment == nil),
|
log.Warn("UpdateDropChannel skipping nil or unhealthy", zap.Bool("is nil", segment == nil),
|
||||||
zap.Bool("isHealthy", isSegmentHealthy(segment)))
|
zap.Bool("isHealthy", isSegmentHealthy(segment)))
|
||||||
return nil, nil
|
return nil, metricMutation
|
||||||
}
|
}
|
||||||
|
|
||||||
metricMutation := &segMetricMutation{
|
|
||||||
stateChange: make(map[string]int),
|
|
||||||
}
|
|
||||||
clonedSegment := segment.Clone()
|
clonedSegment := segment.Clone()
|
||||||
updateSegStateAndPrepareMetrics(clonedSegment, commonpb.SegmentState_Dropped, metricMutation)
|
updateSegStateAndPrepareMetrics(clonedSegment, commonpb.SegmentState_Dropped, metricMutation)
|
||||||
|
|
||||||
|
|
|
@ -975,7 +975,7 @@ class TestUtilityBase(TestcaseBase):
|
||||||
assert collection_w.num_entities == nb
|
assert collection_w.num_entities == nb
|
||||||
collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
|
collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
|
||||||
collection_w.load(_async=True)
|
collection_w.load(_async=True)
|
||||||
self.utility_wrap.wait_for_loading_complete(collection_w.name)
|
self.utility_wrap.wait_for_loading_complete(collection_w.name, timeout=45)
|
||||||
res, _ = self.utility_wrap.loading_progress(collection_w.name)
|
res, _ = self.utility_wrap.loading_progress(collection_w.name)
|
||||||
assert res[loading_progress] == '100%'
|
assert res[loading_progress] == '100%'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue