未验证 提交 22fddc53 编写于 作者: C congqixia 提交者: GitHub

Fix not all segment state is drop after DropVirtualChannel (#12702)

Signed-off-by: NCongqi Xia <congqi.xia@zilliz.com>
上级 877bfdac
......@@ -351,6 +351,19 @@ func (m *meta) UpdateDropChannelSegmentInfo(channel string, segments []*SegmentI
modSegments[seg2Drop.GetID()] = segment
}
}
// set all channels of channel to dropped
for _, seg := range m.segments.segments {
if seg.InsertChannel != channel {
continue
}
_, ok := modSegments[seg.ID]
// seg inf mod segments are all in dropped state
if !ok {
clonedSeg := seg.Clone()
clonedSeg.State = commonpb.SegmentState_Dropped
modSegments[seg.ID] = clonedSeg
}
}
return m.batchSaveDropSegments(channel, modSegments)
}
......
......@@ -960,6 +960,16 @@ func TestDropVirtualChannel(t *testing.T) {
err := svr.meta.AddSegment(NewSegmentInfo(s))
assert.Nil(t, err)
}
// add non matched segments
os := &datapb.SegmentInfo{
ID: maxOperationsPerTxn + 100,
CollectionID: 0,
InsertChannel: "ch2",
State: commonpb.SegmentState_Growing,
}
svr.meta.AddSegment(NewSegmentInfo(os))
err := svr.channelManager.AddNode(0)
require.Nil(t, err)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册