mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 11:29:48 +08:00
Fix QueryNode panic when meta changed (#19902)
Signed-off-by: yah01 <yang.cen@zilliz.com> Signed-off-by: yah01 <yang.cen@zilliz.com>
This commit is contained in:
parent
c9d4f10ce5
commit
5dcff9ab72
@ -83,8 +83,11 @@ func (dNode *deleteNode) Operate(in []flowgraph.Msg) []flowgraph.Msg {
|
|||||||
|
|
||||||
collection, err := dNode.metaReplica.getCollectionByID(dNode.collectionID)
|
collection, err := dNode.metaReplica.getCollectionByID(dNode.collectionID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// QueryNode should add collection before start flow graph
|
log.Warn("failed to get collection",
|
||||||
panic(fmt.Errorf("%s getCollectionByID failed, collectionID = %d, channel = %s", dNode.Name(), dNode.collectionID, dNode.channel))
|
zap.Int64("collectionID", dNode.collectionID),
|
||||||
|
zap.String("channel", dNode.channel),
|
||||||
|
)
|
||||||
|
return []Msg{}
|
||||||
}
|
}
|
||||||
collection.RLock()
|
collection.RLock()
|
||||||
defer collection.RUnlock()
|
defer collection.RUnlock()
|
||||||
@ -120,9 +123,12 @@ func (dNode *deleteNode) Operate(in []flowgraph.Msg) []flowgraph.Msg {
|
|||||||
segment, err := dNode.metaReplica.getSegmentByID(segmentID, segmentTypeSealed)
|
segment, err := dNode.metaReplica.getSegmentByID(segmentID, segmentTypeSealed)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// should not happen, segment should be created before
|
// should not happen, segment should be created before
|
||||||
err = fmt.Errorf("deleteNode getSegmentByID failed, err = %s", err)
|
log.Warn("failed to get segment",
|
||||||
log.Error(err.Error())
|
zap.Int64("collectionID", dNode.collectionID),
|
||||||
panic(err)
|
zap.Int64("segmentID", segmentID),
|
||||||
|
zap.String("channel", dNode.channel),
|
||||||
|
)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
offset := segment.segmentPreDelete(len(pks))
|
offset := segment.segmentPreDelete(len(pks))
|
||||||
delData.deleteOffset[segmentID] = offset
|
delData.deleteOffset[segmentID] = offset
|
||||||
|
Loading…
Reference in New Issue
Block a user