diff --git a/internal/proxy/proxy_test.go b/internal/proxy/proxy_test.go index 2500b8781e..1d26a5107d 100644 --- a/internal/proxy/proxy_test.go +++ b/internal/proxy/proxy_test.go @@ -1340,7 +1340,7 @@ func TestProxy(t *testing.T) { Base: nil, }) assert.NoError(t, err) - assert.Equal(t, commonpb.ErrorCode_Success, resp.ErrorCode) + assert.Equal(t, commonpb.ErrorCode_UnexpectedError, resp.ErrorCode) }) // TODO(dragondriver): dummy diff --git a/internal/querycoord/impl.go b/internal/querycoord/impl.go index cc58c6f06c..700776b318 100644 --- a/internal/querycoord/impl.go +++ b/internal/querycoord/impl.go @@ -562,7 +562,7 @@ func (qc *QueryCoord) LoadBalance(ctx context.Context, req *querypb.LoadBalanceR return status, nil } - baseTask := newBaseTask(qc.loopCtx, querypb.TriggerCondition_grpcRequest) + baseTask := newBaseTask(qc.loopCtx, querypb.TriggerCondition_loadBalance) loadBalanceTask := &loadBalanceTask{ baseTask: baseTask, LoadBalanceRequest: req, @@ -582,7 +582,7 @@ func (qc *QueryCoord) LoadBalance(ctx context.Context, req *querypb.LoadBalanceR if err != nil { status.ErrorCode = commonpb.ErrorCode_UnexpectedError status.Reason = err.Error() - return status, nil + return status, err } log.Debug("LoadBalanceRequest completed", zap.String("role", Params.RoleName), diff --git a/internal/querycoord/impl_test.go b/internal/querycoord/impl_test.go index e3904109d3..740be44863 100644 --- a/internal/querycoord/impl_test.go +++ b/internal/querycoord/impl_test.go @@ -189,16 +189,6 @@ func TestGrpcTask(t *testing.T) { assert.Nil(t, err) }) - t.Run("Test LoadBalance", func(t *testing.T) { - res, err := queryCoord.LoadBalance(ctx, &querypb.LoadBalanceRequest{ - Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_SegmentInfo, - }, - }) - assert.NoError(t, err) - assert.Equal(t, commonpb.ErrorCode_Success, res.ErrorCode) - }) - t.Run("Test ReleaseParOfNotLoadedCol", func(t *testing.T) { status, err := queryCoord.ReleasePartitions(ctx, &querypb.ReleasePartitionsRequest{ Base: &commonpb.MsgBase{ @@ -299,9 +289,8 @@ func TestGrpcTask(t *testing.T) { MsgType: commonpb.MsgType_LoadBalanceSegments, }, }) - assert.NoError(t, err) - assert.Equal(t, commonpb.ErrorCode_Success, res.ErrorCode) - assert.Nil(t, err) + assert.Equal(t, commonpb.ErrorCode_UnexpectedError, res.ErrorCode) + assert.NotNil(t, err) }) t.Run("Test GetMetrics", func(t *testing.T) {