未验证 提交 a271940d 编写于 作者: S SimFG 提交者: GitHub

Return error response when an unimplemented request is received (#24546)

Signed-off-by: NSimFG <bang.fu@zilliz.com>
上级 8da5b6a6
......@@ -17,11 +17,11 @@
package memkv
import (
"errors"
"strings"
"sync"
"github.com/google/btree"
"github.com/milvus-io/milvus/internal/common"
)
......@@ -284,7 +284,7 @@ func (kv *MemoryKV) Close() {
// MultiRemoveWithPrefix not implemented
func (kv *MemoryKV) MultiRemoveWithPrefix(keys []string) error {
panic("not implement")
return errors.New("not implement")
}
// MultiSaveAndRemoveWithPrefix saves key-value pairs in @saves, & remove key with prefix in @removals in MemoryKV atomically.
......
......@@ -3773,7 +3773,12 @@ func (node *Proxy) FlushAll(ctx context.Context, _ *milvuspb.FlushAllRequest) (*
// GetDdChannel returns the used channel for dd operations.
func (node *Proxy) GetDdChannel(ctx context.Context, request *internalpb.GetDdChannelRequest) (*milvuspb.StringResponse, error) {
panic("implement me")
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "TODO: implement me",
},
}, nil
}
// GetPersistentSegmentInfo get the information of sealed segment.
......
......@@ -1451,10 +1451,8 @@ func TestProxy(t *testing.T) {
})
t.Run("get dd channel", func(t *testing.T) {
f := func() {
_, _ = proxy.GetDdChannel(ctx, &internalpb.GetDdChannelRequest{})
}
assert.Panics(t, f)
resp, _ := proxy.GetDdChannel(ctx, &internalpb.GetDdChannelRequest{})
assert.NotEqual(t, commonpb.ErrorCode_Success, resp.Status.ErrorCode)
})
wg.Add(1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册