add array hashKeys empty check (#15796)

fix #15791 https://github.com/milvus-io/milvus/issues/15791
Signed-off-by: zhuyaguang <zhuyaguang1368@163.com>
This commit is contained in:
朱亚光 2022-03-03 00:33:56 +08:00 committed by GitHub
parent 9f4c59e621
commit 27a7875a15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -788,6 +788,9 @@ func (it *insertTask) _assignSegmentID(stream msgstream.MsgStream, pack *msgstre
}
tsMsgs := pack.Msgs
hashKeys := stream.ComputeProduceChannelIndexes(tsMsgs)
if len(hashKeys) == 0 {
return nil, fmt.Errorf("the length of hashKeys is 0")
}
reqID := it.Base.MsgID
channelCountMap := make(map[int32]uint32) // channelID to count
channelMaxTSMap := make(map[int32]Timestamp) // channelID to max Timestamp