mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 21:09:06 +08:00
Use merr to prevent datanode panic (#28121)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
501cba90ce
commit
8d080383b7
@ -18,7 +18,6 @@ package datanode
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"math"
|
"math"
|
||||||
"path"
|
"path"
|
||||||
"sync"
|
"sync"
|
||||||
@ -201,7 +200,7 @@ func (c *ChannelMeta) getCollectionAndPartitionID(segID UniqueID) (collID, parti
|
|||||||
if seg, ok := c.segments[segID]; ok && seg.isValid() {
|
if seg, ok := c.segments[segID]; ok && seg.isValid() {
|
||||||
return seg.collectionID, seg.partitionID, nil
|
return seg.collectionID, seg.partitionID, nil
|
||||||
}
|
}
|
||||||
return 0, 0, fmt.Errorf("cannot find segment, id = %d", segID)
|
return 0, 0, merr.WrapErrSegmentNotFound(segID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ChannelMeta) getChannelName() string {
|
func (c *ChannelMeta) getChannelName() string {
|
||||||
@ -640,7 +639,7 @@ func (c *ChannelMeta) getSegmentStatisticsUpdates(segID UniqueID) (*commonpb.Seg
|
|||||||
return &commonpb.SegmentStats{SegmentID: segID, NumRows: seg.numRows}, nil
|
return &commonpb.SegmentStats{SegmentID: segID, NumRows: seg.numRows}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fmt.Errorf("error, there's no segment %d", segID)
|
return nil, merr.WrapErrSegmentNotFound(segID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ChannelMeta) getCollectionID() UniqueID {
|
func (c *ChannelMeta) getCollectionID() UniqueID {
|
||||||
|
Loading…
Reference in New Issue
Block a user