From 6d7edc60150d422b9cf1230205b6760ed88999b7 Mon Sep 17 00:00:00 2001 From: neza2017 Date: Sat, 26 Jun 2021 18:04:12 +0800 Subject: [PATCH] fix typo (#6142) * fix typo Signed-off-by: yefu.chen * add log Signed-off-by: yefu.chen --- internal/distributed/rootcoord/client/client.go | 2 +- internal/rootcoord/root_coord_test.go | 2 +- internal/util/sessionutil/session_util.go | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/distributed/rootcoord/client/client.go b/internal/distributed/rootcoord/client/client.go index 1187a4eb89..8fcebc57f6 100644 --- a/internal/distributed/rootcoord/client/client.go +++ b/internal/distributed/rootcoord/client/client.go @@ -56,7 +56,7 @@ func getRootCoordAddr(sess *sessionutil.Session) (string, error) { ms, ok := msess[key] if !ok { log.Debug("RootCoordClient mess key not exist", zap.Any("key", key)) - return "", fmt.Errorf("number of master service is incorrect, %d", len(msess)) + return "", fmt.Errorf("number of RootCoord is incorrect, %d", len(msess)) } return ms.Address, nil } diff --git a/internal/rootcoord/root_coord_test.go b/internal/rootcoord/root_coord_test.go index d090b12950..713dec78a1 100644 --- a/internal/rootcoord/root_coord_test.go +++ b/internal/rootcoord/root_coord_test.go @@ -1288,6 +1288,7 @@ func TestRootCoord(t *testing.T) { }) assert.Nil(t, err) assert.NotEqual(t, commonpb.ErrorCode_Success, rsp8.Status.ErrorCode) + time.Sleep(10 * time.Second) }) @@ -1445,7 +1446,6 @@ func TestRootCoord(t *testing.T) { }) assert.Nil(t, err) assert.NotEqual(t, commonpb.ErrorCode_Success, rsp8.Status.ErrorCode) - time.Sleep(5 * time.Second) }) diff --git a/internal/util/sessionutil/session_util.go b/internal/util/sessionutil/session_util.go index dba09b1a2d..c922b7bef3 100644 --- a/internal/util/sessionutil/session_util.go +++ b/internal/util/sessionutil/session_util.go @@ -101,18 +101,19 @@ func (s *Session) getServerID() (int64, error) { } func (s *Session) checkIDExist() { + log.Debug("Session checkIDExist Begin") s.etcdCli.Txn(s.ctx).If( clientv3.Compare( clientv3.Version(path.Join(s.metaRoot, DefaultServiceRoot, DefaultIDKey)), "=", 0)). Then(clientv3.OpPut(path.Join(s.metaRoot, DefaultServiceRoot, DefaultIDKey), "1")).Commit() - + log.Debug("Session checkIDExist End") } func (s *Session) getServerIDWithKey(key string, retryTimes uint) (int64, error) { for { - log.Debug("Session try to get servdeID") + log.Debug("Session try to get serverID") getResp, err := s.etcdCli.Get(s.ctx, path.Join(s.metaRoot, DefaultServiceRoot, key)) if err != nil { log.Debug("Session get etcd key error", zap.String("key", key), zap.Error(err)) @@ -143,6 +144,7 @@ func (s *Session) getServerIDWithKey(key string, retryTimes uint) (int64, error) log.Debug("Session Txn unsuccess", zap.String("key", key)) continue } + log.Debug("Session get serverID success") return valueInt, nil } }