Skip to content

Commit

Permalink
fix hasCollection response has no status
Browse files Browse the repository at this point in the history
Signed-off-by: wayblink <[email protected]>
  • Loading branch information
wayblink committed Oct 29, 2024
1 parent 86b9c3e commit 7181b04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/proxy/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,9 @@ func (t *hasCollectionTask) PreExecute(ctx context.Context) error {

func (t *hasCollectionTask) Execute(ctx context.Context) error {
_, err := globalMetaCache.GetCollectionID(ctx, t.HasCollectionRequest.GetDbName(), t.HasCollectionRequest.GetCollectionName())
t.result = &milvuspb.BoolResponse{}
t.result = &milvuspb.BoolResponse{
Status: merr.Status(err),
}
// error other than
if err != nil && !errors.Is(err, merr.ErrCollectionNotFound) {
return err
Expand Down
1 change: 1 addition & 0 deletions internal/proxy/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ func TestHasCollectionTask(t *testing.T) {
err = task.Execute(ctx)
assert.NoError(t, err)
assert.False(t, task.result.GetValue())
assert.NotEmpty(t, task.result.GetStatus())

// rootcoord failed to get response
rc.updateState(commonpb.StateCode_Abnormal)
Expand Down

0 comments on commit 7181b04

Please sign in to comment.