Fix query task panicking (#8060)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/8114/head
congqixia 2021-09-16 20:03:50 +08:00 committed by GitHub
parent 41cb0f30cb
commit 4fe22bcaaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -2464,13 +2464,14 @@ func (qt *queryTask) PostExecute(ctx context.Context) error {
},
FieldsData: make([]*schemapb.FieldData, 0),
}
for idx, partialRetrieveResult := range retrieveResult {
for _, partialRetrieveResult := range retrieveResult {
availableQueryNodeNum++
if partialRetrieveResult.Ids == nil {
reason += "ids is nil\n"
continue
} else {
if idx == 0 {
// handles initialization, cannot use idx==0 since first result may be empty
if len(qt.result.FieldsData) == 0 {
qt.result.FieldsData = append(qt.result.FieldsData, partialRetrieveResult.FieldsData...)
} else {
for k, fieldData := range partialRetrieveResult.FieldsData {