Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix hasCollection response has no status #37254

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion internal/proxy/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,13 @@ func (t *hasCollectionTask) PreExecute(ctx context.Context) error {
}

func (t *hasCollectionTask) Execute(ctx context.Context) error {
t.result = &milvuspb.BoolResponse{
Status: merr.Success(),
}
_, err := globalMetaCache.GetCollectionID(ctx, t.HasCollectionRequest.GetDbName(), t.HasCollectionRequest.GetCollectionName())
t.result = &milvuspb.BoolResponse{}
// error other than
if err != nil && !errors.Is(err, merr.ErrCollectionNotFound) {
t.result.Status = merr.Status(err)
return err
}
// if collection not nil, means error is ErrCollectionNotFound, result is false
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.NotNil(t, task.result.GetStatus())

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