Fix QueryCollection retrieve unit test (#16376)

Signed-off-by: Letian Jiang <letian.jiang@zilliz.com>
pull/16385/head
Letian Jiang 2022-04-04 21:07:30 +08:00 committed by GitHub
parent 2bd0a9526a
commit 09b90fd8bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 10 deletions

View File

@ -1459,8 +1459,8 @@ func genSimpleRetrievePlanExpr() ([]byte, error) {
Expr: &planpb.Expr_TermExpr{ Expr: &planpb.Expr_TermExpr{
TermExpr: &planpb.TermExpr{ TermExpr: &planpb.TermExpr{
ColumnInfo: &planpb.ColumnInfo{ ColumnInfo: &planpb.ColumnInfo{
FieldId: simpleConstField.id, FieldId: simplePKField.id,
DataType: simpleConstField.dataType, DataType: simplePKField.dataType,
}, },
Values: []*planpb.GenericValue{ Values: []*planpb.GenericValue{
{ {
@ -1483,7 +1483,7 @@ func genSimpleRetrievePlanExpr() ([]byte, error) {
}, },
}, },
}, },
OutputFieldIds: []int64{simpleConstField.id}, OutputFieldIds: []int64{simplePKField.id},
} }
planExpr, err := proto.Marshal(planNode) planExpr, err := proto.Marshal(planNode)
return planExpr, err return planExpr, err

View File

@ -1333,6 +1333,7 @@ func (q *queryCollection) retrieve(msg queryMsg) error {
if err != nil { if err != nil {
return err return err
} }
log.Debug("retrieve result", zap.String("ids", result.Ids.String()))
reduceDuration := tr.Record(fmt.Sprintf("merge result done, msgID = %d", retrieveMsg.ID())) reduceDuration := tr.Record(fmt.Sprintf("merge result done, msgID = %d", retrieveMsg.ID()))
metrics.QueryNodeReduceLatency.WithLabelValues(fmt.Sprint(Params.QueryNodeCfg.QueryNodeID), metrics.QueryLabel).Observe(float64(reduceDuration.Milliseconds())) metrics.QueryNodeReduceLatency.WithLabelValues(fmt.Sprint(Params.QueryNodeCfg.QueryNodeID), metrics.QueryLabel).Observe(float64(reduceDuration.Milliseconds()))

View File

@ -656,7 +656,7 @@ func TestQueryCollection_search(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
} }
func TestQueryCollection_receive(t *testing.T) { func TestQueryCollection_retrieve(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
queryCollection, err := genSimpleQueryCollection(ctx, cancel) queryCollection, err := genSimpleQueryCollection(ctx, cancel)
@ -677,12 +677,6 @@ func TestQueryCollection_receive(t *testing.T) {
queryCollection.vectorChunkManager = vecCM queryCollection.vectorChunkManager = vecCM
err = queryCollection.streaming.replica.removeSegment(defaultSegmentID)
assert.NoError(t, err)
err = queryCollection.historical.replica.removeSegment(defaultSegmentID)
assert.NoError(t, err)
msg, err := genSimpleRetrieveMsg() msg, err := genSimpleRetrieveMsg()
assert.NoError(t, err) assert.NoError(t, err)