fix getting wrong offset when segment preinsert

Signed-off-by: xige-16 <xi.ge@zilliz.com>
pull/4973/head^2
xige-16 2021-03-31 16:16:58 +08:00 committed by yefu.chen
parent 18e0581d5c
commit c10b36f188
4 changed files with 6 additions and 2 deletions

View File

@ -1128,6 +1128,7 @@ func (node *ProxyNode) GetPersistentSegmentInfo(ctx context.Context, req *milvus
},
SegmentIDs: segments,
})
log.Debug("GetPersistentSegmentInfo ", zap.Any("infos", infoResp.Infos), zap.Any("status", infoResp.Status))
if err != nil {
resp.Status.Reason = fmt.Errorf("dataService:GetSegmentInfo, err:%w", err).Error()
return resp, nil
@ -1180,6 +1181,7 @@ func (node *ProxyNode) GetQuerySegmentInfo(ctx context.Context, req *milvuspb.Ge
},
SegmentIDs: segments,
})
log.Debug("GetQuerySegmentInfo ", zap.Any("infos", infoResp.Infos), zap.Any("status", infoResp.Status))
if err != nil {
resp.Status.Reason = err.Error()
return resp, nil

View File

@ -102,6 +102,7 @@ func (iNode *insertNode) Operate(in []flowgraph.Msg) []flowgraph.Msg {
log.Error(err.Error())
}
insertData.insertOffset[segmentID] = offset
log.Debug("insertNode operator", zap.Int("insert size", numOfRecords), zap.Int64("insert offset", offset), zap.Int64("segment id", segmentID))
}
}

View File

@ -316,8 +316,8 @@ func (s *Segment) segmentPreInsert(numOfRecords int) (int64, error) {
return 0, nil
}
var offset int64
cOffset := C.long(offset)
status := C.PreInsert(s.segmentPtr, C.long(int64(numOfRecords)), &cOffset)
cOffset := (*C.long)(&offset)
status := C.PreInsert(s.segmentPtr, C.long(int64(numOfRecords)), cOffset)
errorCode := status.error_code

View File

@ -436,6 +436,7 @@ func (qs *QueryService) LoadPartitions(ctx context.Context, req *querypb.LoadPar
if err != nil {
return fn(err), err
}
log.Debug("getSegmentStates result ", zap.Any("segment states", resp.States), zap.Any("result status", resp.Status))
for _, state := range resp.States {
log.Debug("segment ", zap.String("state.SegmentID", fmt.Sprintln(state.SegmentID)), zap.String("state", fmt.Sprintln(state.StartPosition)))
segmentID := state.SegmentID