From 7181b04b63ab66ebe49beb1abf53ad3a54fcb998 Mon Sep 17 00:00:00 2001 From: wayblink Date: Tue, 29 Oct 2024 17:14:00 +0800 Subject: [PATCH] fix hasCollection response has no status Signed-off-by: wayblink --- internal/proxy/task.go | 4 +++- internal/proxy/task_test.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/proxy/task.go b/internal/proxy/task.go index 5bfcf4ab3fa45..9912f0e570f7a 100644 --- a/internal/proxy/task.go +++ b/internal/proxy/task.go @@ -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 diff --git a/internal/proxy/task_test.go b/internal/proxy/task_test.go index 2eb4b219e2921..8eda48de8d2d6 100644 --- a/internal/proxy/task_test.go +++ b/internal/proxy/task_test.go @@ -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)