Fix active-standby switch fail bug (#21747)

Signed-off-by: wayblink <anyang.wang@zilliz.com>
pull/21762/head
wayblink 2023-01-17 11:41:51 +08:00 committed by GitHub
parent 3a5f38b1df
commit f081c3c692
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -780,9 +780,9 @@ func (s *Session) ProcessActiveStandBy(activateFunc func()) error {
if registered {
break
}
log.Info(fmt.Sprintf("%s start to watch ACTIVE key", s.ServerName))
log.Info(fmt.Sprintf("%s start to watch ACTIVE key %s", s.ServerName, s.activeKey))
ctx, cancel := context.WithCancel(s.ctx)
watchChan := s.etcdCli.Watch(ctx, s.activeKey, clientv3.WithPrefix(), clientv3.WithPrevKV(), clientv3.WithRev(revision))
watchChan := s.etcdCli.Watch(ctx, s.activeKey, clientv3.WithPrevKV(), clientv3.WithRev(revision))
select {
case <-ctx.Done():
cancel()