Fix recovery branch after rebasing master (#5444)

Signed-off-by: sunby <bingyi.sun@zilliz.com>
This commit is contained in:
sunby 2021-05-27 11:05:36 +08:00 committed by zhenshan.cao
parent 07c6a4a669
commit cfdd98b70f
3 changed files with 6 additions and 7 deletions

View File

@ -137,7 +137,7 @@ func (node *DataNode) Register() error {
func (node *DataNode) Init() error {
ctx := context.Background()
node.session = sessionutil.NewSession(ctx, []string{Params.EtcdAddress})
node.session = sessionutil.NewSession(ctx, Params.MetaRootPath, []string{Params.EtcdAddress})
node.session.Init(typeutil.DataNodeRole, Params.IP+":"+strconv.Itoa(Params.Port), false)
// TODO find DataService & MasterService

View File

@ -12,7 +12,6 @@ package dataservice
import (
"sync"
"time"
"github.com/milvus-io/milvus/internal/types"
)
@ -28,10 +27,10 @@ type sessionManager interface {
type clusterSessionManager struct {
mu sync.RWMutex
sessions map[string]types.DataNode
dataClientCreator func(addr string, timeout time.Duration) (types.DataNode, error)
dataClientCreator func(addr string) (types.DataNode, error)
}
func newClusterSessionManager(dataClientCreator func(addr string, timeout time.Duration) (types.DataNode, error)) *clusterSessionManager {
func newClusterSessionManager(dataClientCreator func(addr string) (types.DataNode, error)) *clusterSessionManager {
return &clusterSessionManager{
sessions: make(map[string]types.DataNode),
dataClientCreator: dataClientCreator,
@ -39,7 +38,7 @@ func newClusterSessionManager(dataClientCreator func(addr string, timeout time.D
}
func (m *clusterSessionManager) createSession(addr string) error {
cli, err := m.dataClientCreator(addr, 0)
cli, err := m.dataClientCreator(addr)
if err != nil {
return err
}

View File

@ -84,7 +84,7 @@ func CreateServer(ctx context.Context, factory msgstream.Factory) (*Server, erro
msFactory: factory,
}
s.dataClientCreator = func(addr string) (types.DataNode, error) {
return grpcdatanodeclient.NewClient(addr)
return grpcdatanodeclient.NewClient(addr, 10*time.Second)
}
s.UpdateStateCode(internalpb.StateCode_Abnormal)
@ -114,7 +114,7 @@ func (s *Server) Register() error {
func (s *Server) Init() error {
s.initOnce.Do(func() {
s.session = sessionutil.NewSession(s.ctx, []string{Params.EtcdAddress})
s.session = sessionutil.NewSession(s.ctx, Params.MetaRootPath, []string{Params.EtcdAddress})
})
return nil
}