Fix querynode memory leak

Signed-off-by: xige-16 <xi.ge@zilliz.com>
pull/4973/head^2
xige-16 2021-02-20 09:20:51 +08:00 committed by yefu.chen
parent 7b71b7e98e
commit a6442cb600
3 changed files with 13 additions and 2 deletions

View File

@ -246,7 +246,7 @@ func (ibNode *insertBufferNode) Operate(in []*Msg) []*Msg {
var offset int
for _, blob := range msg.RowData {
bv := blob.GetValue()[pos+offset : pos+(dim/8)]
bv := blob.GetValue()[pos : pos+(dim/8)]
fieldData.Data = append(fieldData.Data, bv...)
offset = len(bv)
}

View File

@ -436,6 +436,11 @@ func (s *Segment) segmentLoadFieldData(fieldID int64, rowCount int, data interfa
return emptyErr
}
dataPointer = unsafe.Pointer(&d[0])
case []byte:
if len(d) <= 0 {
return emptyErr
}
dataPointer = unsafe.Pointer(&d[0])
case []int8:
if len(d) <= 0 {
return emptyErr

View File

@ -7,6 +7,7 @@ import (
"strconv"
"sync"
"sync/atomic"
"time"
nodeclient "github.com/zilliztech/milvus-distributed/internal/distributed/querynode/client"
"github.com/zilliztech/milvus-distributed/internal/errors"
@ -16,6 +17,7 @@ import (
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb2"
"github.com/zilliztech/milvus-distributed/internal/proto/milvuspb"
"github.com/zilliztech/milvus-distributed/internal/proto/querypb"
"github.com/zilliztech/milvus-distributed/internal/util/retry"
)
type MasterServiceInterface interface {
@ -541,7 +543,11 @@ func (qs *QueryService) CreateQueryChannel() (*querypb.CreateQueryChannelRespons
fmt.Println("query service create query channel, queryChannelName = ", allocatedQueryChannel)
for nodeID, node := range qs.queryNodes {
fmt.Println("node ", nodeID, " watch query channel")
_, err := node.AddQueryChannel(addQueryChannelsRequest)
fn := func() error {
_, err := node.AddQueryChannel(addQueryChannelsRequest)
return err
}
err := retry.Retry(10, time.Millisecond*200, fn)
if err != nil {
qs.qcMutex.Unlock()
return &querypb.CreateQueryChannelResponse{