From 27a7875a1595576b5e9be77eea66eb39ebdeece2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E4=BA=9A=E5=85=89?= Date: Thu, 3 Mar 2022 00:33:56 +0800 Subject: [PATCH] add array hashKeys empty check (#15796) fix #15791 https://github.com/milvus-io/milvus/issues/15791 Signed-off-by: zhuyaguang --- internal/proxy/task.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/proxy/task.go b/internal/proxy/task.go index a674031395..a9ad121e06 100644 --- a/internal/proxy/task.go +++ b/internal/proxy/task.go @@ -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