Use typeutil.ProxyRole instead of Params.RoleName in proxy (#13217)

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
Cai Yudong 2021-12-13 10:01:18 +08:00 committed by GitHub
parent 2b59e15ef4
commit b5d639a1ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 167 additions and 164 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@ package proxy
import (
"testing"
"github.com/milvus-io/milvus/internal/util/typeutil"
"github.com/stretchr/testify/assert"
)
@ -88,7 +89,7 @@ func TestParamTable_Normal(t *testing.T) {
})
t.Run("RoleName", func(t *testing.T) {
t.Logf("RoleName: %s", Params.RoleName)
t.Logf("RoleName: %s", typeutil.ProxyRole)
})
t.Run("MaxTaskNum", func(t *testing.T) {

View File

@ -349,17 +349,17 @@ func (node *Proxy) Stop() error {
if node.idAllocator != nil {
node.idAllocator.Close()
log.Info("close id allocator", zap.String("role", Params.RoleName))
log.Info("close id allocator", zap.String("role", typeutil.ProxyRole))
}
if node.segAssigner != nil {
node.segAssigner.Close()
log.Info("close segment id assigner", zap.String("role", Params.RoleName))
log.Info("close segment id assigner", zap.String("role", typeutil.ProxyRole))
}
if node.sched != nil {
node.sched.Close()
log.Info("close scheduler", zap.String("role", Params.RoleName))
log.Info("close scheduler", zap.String("role", typeutil.ProxyRole))
}
if node.chTicker != nil {
@ -367,7 +367,7 @@ func (node *Proxy) Stop() error {
if err != nil {
return err
}
log.Info("close channels time ticker", zap.String("role", Params.RoleName))
log.Info("close channels time ticker", zap.String("role", typeutil.ProxyRole))
}
node.wg.Wait()

View File

@ -4147,7 +4147,7 @@ func (lct *loadCollectionTask) OnEnqueue() error {
}
func (lct *loadCollectionTask) PreExecute(ctx context.Context) error {
log.Debug("loadCollectionTask PreExecute", zap.String("role", Params.RoleName), zap.Int64("msgID", lct.Base.MsgID))
log.Debug("loadCollectionTask PreExecute", zap.String("role", typeutil.ProxyRole), zap.Int64("msgID", lct.Base.MsgID))
lct.Base.MsgType = commonpb.MsgType_LoadCollection
lct.Base.SourceID = Params.ProxyID
@ -4161,7 +4161,7 @@ func (lct *loadCollectionTask) PreExecute(ctx context.Context) error {
}
func (lct *loadCollectionTask) Execute(ctx context.Context) (err error) {
log.Debug("loadCollectionTask Execute", zap.String("role", Params.RoleName), zap.Int64("msgID", lct.Base.MsgID))
log.Debug("loadCollectionTask Execute", zap.String("role", typeutil.ProxyRole), zap.Int64("msgID", lct.Base.MsgID))
collID, err := globalMetaCache.GetCollectionID(ctx, lct.CollectionName)
if err != nil {
return err
@ -4182,7 +4182,8 @@ func (lct *loadCollectionTask) Execute(ctx context.Context) (err error) {
CollectionID: collID,
Schema: collSchema,
}
log.Debug("send LoadCollectionRequest to query coordinator", zap.String("role", Params.RoleName), zap.Int64("msgID", request.Base.MsgID), zap.Int64("collectionID", request.CollectionID),
log.Debug("send LoadCollectionRequest to query coordinator", zap.String("role", typeutil.ProxyRole),
zap.Int64("msgID", request.Base.MsgID), zap.Int64("collectionID", request.CollectionID),
zap.Any("schema", request.Schema))
lct.result, err = lct.queryCoord.LoadCollection(ctx, request)
if err != nil {
@ -4192,7 +4193,8 @@ func (lct *loadCollectionTask) Execute(ctx context.Context) (err error) {
}
func (lct *loadCollectionTask) PostExecute(ctx context.Context) error {
log.Debug("loadCollectionTask PostExecute", zap.String("role", Params.RoleName), zap.Int64("msgID", lct.Base.MsgID))
log.Debug("loadCollectionTask PostExecute", zap.String("role", typeutil.ProxyRole),
zap.Int64("msgID", lct.Base.MsgID))
return nil
}