mirror of https://github.com/milvus-io/milvus.git
Fix write node crashed if collection meta not existed
Signed-off-by: neza2017 <yefu.chen@zilliz.com>pull/4973/head^2
parent
fa77783ad7
commit
8b39643e44
|
@ -542,15 +542,21 @@ func (ibNode *insertBufferNode) getMeta(segID UniqueID) (*etcdpb.SegmentMeta, *e
|
||||||
segMeta := &etcdpb.SegmentMeta{}
|
segMeta := &etcdpb.SegmentMeta{}
|
||||||
|
|
||||||
key := path.Join(SegmentPrefix, strconv.FormatInt(segID, 10))
|
key := path.Join(SegmentPrefix, strconv.FormatInt(segID, 10))
|
||||||
value, _ := ibNode.kvClient.Load(key)
|
value, err := ibNode.kvClient.Load(key)
|
||||||
err := proto.UnmarshalText(value, segMeta)
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
err = proto.UnmarshalText(value, segMeta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
collMeta := &etcdpb.CollectionMeta{}
|
collMeta := &etcdpb.CollectionMeta{}
|
||||||
key = path.Join(CollectionPrefix, strconv.FormatInt(segMeta.GetCollectionID(), 10))
|
key = path.Join(CollectionPrefix, strconv.FormatInt(segMeta.GetCollectionID(), 10))
|
||||||
value, _ = ibNode.kvClient.Load(key)
|
value, err = ibNode.kvClient.Load(key)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
err = proto.UnmarshalText(value, collMeta)
|
err = proto.UnmarshalText(value, collMeta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
|
|
Loading…
Reference in New Issue