mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix compaction panic (#17840)
See also: #17823 Signed-off-by: yangxuan <xuan.yang@zilliz.com>
This commit is contained in:
parent
24b3ad22d7
commit
ff3c4ab2a8
@ -1071,7 +1071,8 @@ func buildSegment(collectionID UniqueID, partitionID UniqueID, segmentID UniqueI
|
||||
}
|
||||
|
||||
func isSegmentHealthy(segment *SegmentInfo) bool {
|
||||
return segment.GetState() != commonpb.SegmentState_SegmentStateNone &&
|
||||
return segment != nil &&
|
||||
segment.GetState() != commonpb.SegmentState_SegmentStateNone &&
|
||||
segment.GetState() != commonpb.SegmentState_NotExist &&
|
||||
segment.GetState() != commonpb.SegmentState_Dropped
|
||||
}
|
||||
|
||||
@ -755,3 +755,9 @@ func TestMeta_GetAllSegments(t *testing.T) {
|
||||
assert.Nil(t, seg2)
|
||||
assert.NotNil(t, seg2All)
|
||||
}
|
||||
|
||||
func TestMeta_isSegmentHealthy_issue17823_panic(t *testing.T) {
|
||||
var seg *SegmentInfo
|
||||
|
||||
assert.False(t, isSegmentHealthy(seg))
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user