Fix active-standby switch fail bug (#21755)

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

View File

@ -829,9 +829,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()