Fix proxy unable to update cache (#16646)

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
pull/16659/head
XuanYang-cn 2022-04-26 11:27:53 +08:00 committed by GitHub
parent bc5e9ec929
commit fbc7fe1cdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 6 deletions

View File

@ -244,7 +244,7 @@ func (c *Client) ReleaseSegments(ctx context.Context, req *querypb.ReleaseSegmen
// Search performs replica search tasks in QueryNode.
func (c *Client) Search(ctx context.Context, req *querypb.SearchRequest) (*internalpb.SearchResults, error) {
ret, err := c.grpcClient.ReCall(ctx, func(client interface{}) (interface{}, error) {
ret, err := c.grpcClient.Call(ctx, func(client interface{}) (interface{}, error) {
if !funcutil.CheckCtxValid(ctx) {
return nil, ctx.Err()
}
@ -258,7 +258,7 @@ func (c *Client) Search(ctx context.Context, req *querypb.SearchRequest) (*inter
// Query performs replica query tasks in QueryNode.
func (c *Client) Query(ctx context.Context, req *querypb.QueryRequest) (*internalpb.RetrieveResults, error) {
ret, err := c.grpcClient.ReCall(ctx, func(client interface{}) (interface{}, error) {
ret, err := c.grpcClient.Call(ctx, func(client interface{}) (interface{}, error) {
if !funcutil.CheckCtxValid(ctx) {
return nil, ctx.Err()
}

View File

@ -3,7 +3,6 @@ package proxy
import (
"context"
"errors"
"fmt"
qnClient "github.com/milvus-io/milvus/internal/distributed/querynode/client"
@ -75,7 +74,11 @@ func roundRobinPolicy(ctx context.Context, getQueryNodePolicy getQueryNodePolicy
}
if current == replicaNum && err != nil {
return fmt.Errorf("no shard leaders available for channel: %s, leaders: %v, err: %s", leaders.GetChannelName(), leaders.GetNodeIds(), err.Error())
log.Warn("no shard leaders available for channel",
zap.String("channel name", leaders.GetChannelName()),
zap.Int64s("leaders", leaders.GetNodeIds()), zap.Error(err))
// needs to return the error from query
return err
}
return nil
}

View File

@ -271,7 +271,7 @@ func (t *queryTask) Execute(ctx context.Context) error {
return executeQuery(WithoutCache)
}
if err != nil {
return err
return fmt.Errorf("fail to search on all shard leaders, err=%s", err.Error())
}
log.Info("Query Execute done.",

View File

@ -295,7 +295,7 @@ func (t *searchTask) Execute(ctx context.Context) error {
return executeSearch(WithoutCache)
}
if err != nil {
return err
return fmt.Errorf("fail to search on all shard leaders, err=%s", err.Error())
}
log.Info("Search Execute done.",