mirror of https://github.com/milvus-io/milvus.git
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com> Signed-off-by: Congqi Xia <congqi.xia@zilliz.com> Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/20392/head
parent
9523a778c1
commit
65a2b1c5a8
internal/proxy
|
@ -101,6 +101,10 @@ func (node *Proxy) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringRe
|
|||
|
||||
// InvalidateCollectionMetaCache invalidate the meta cache of specific collection.
|
||||
func (node *Proxy) InvalidateCollectionMetaCache(ctx context.Context, request *proxypb.InvalidateCollMetaCacheRequest) (*commonpb.Status, error) {
|
||||
if !node.checkHealthy() {
|
||||
return unhealthyStatus(), nil
|
||||
}
|
||||
|
||||
ctx = logutil.WithModule(ctx, moduleName)
|
||||
logutil.Logger(ctx).Info("received request to invalidate collection meta cache",
|
||||
zap.String("role", typeutil.ProxyRole),
|
||||
|
|
|
@ -26,6 +26,7 @@ func TestProxy_InvalidateCollectionMetaCache_remove_stream(t *testing.T) {
|
|||
}
|
||||
|
||||
node := &Proxy{chMgr: chMgr}
|
||||
node.stateCode.Store(commonpb.StateCode_Healthy)
|
||||
|
||||
ctx := context.Background()
|
||||
req := &proxypb.InvalidateCollMetaCacheRequest{
|
||||
|
|
|
@ -2697,6 +2697,12 @@ func TestProxy(t *testing.T) {
|
|||
assert.NotEqual(t, commonpb.ErrorCode_Success, resp.Status.ErrorCode)
|
||||
})
|
||||
|
||||
t.Run("InvalidateCollectionMetaCache failed", func(t *testing.T) {
|
||||
resp, err := proxy.InvalidateCollectionMetaCache(ctx, &proxypb.InvalidateCollMetaCacheRequest{})
|
||||
assert.NoError(t, err)
|
||||
assert.NotEqual(t, commonpb.ErrorCode_Success, resp.GetErrorCode())
|
||||
})
|
||||
|
||||
testProxyRoleUnhealthy(ctx, t, proxy)
|
||||
testProxyPrivilegeUnhealthy(ctx, t, proxy)
|
||||
testProxyRefreshPolicyInfoCacheUnhealthy(ctx, t, proxy)
|
||||
|
|
Loading…
Reference in New Issue