* fix typo

Signed-off-by: yefu.chen <yefu.chen@zilliz.com>

* add log

Signed-off-by: yefu.chen <yefu.chen@zilliz.com>
This commit is contained in:
neza2017 2021-06-26 18:04:12 +08:00 committed by GitHub
parent 6b65529086
commit 6d7edc6015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -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
}

View File

@ -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)
})

View File

@ -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
}
}