Skip to content

Commit

Permalink
Merge branch 'release-7.5' into cherry-pick-8478-to-release-7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch authored Sep 23, 2024
2 parents 28f4af3 + cbc1692 commit b99ba2f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/mcs/scheduling/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import (
"github.com/tikv/pd/pkg/storage/endpoint"
"github.com/tikv/pd/pkg/storage/kv"
"github.com/tikv/pd/pkg/utils/apiutil"
"github.com/tikv/pd/pkg/utils/etcdutil"
"github.com/tikv/pd/pkg/utils/grpcutil"
"github.com/tikv/pd/pkg/utils/logutil"
"github.com/tikv/pd/pkg/utils/memberutil"
Expand Down Expand Up @@ -184,7 +185,7 @@ func (s *Server) updateAPIServerMemberLoop() {
if !s.IsServing() {
continue
}
members, err := s.GetClient().MemberList(ctx)
members, err := etcdutil.ListEtcdMembers(ctx, s.GetClient())
if err != nil {
log.Warn("failed to list members", errs.ZapError(err))
continue
Expand All @@ -199,6 +200,11 @@ func (s *Server) updateAPIServerMemberLoop() {
cc, err := s.GetDelegateClient(ctx, s.GetTLSConfig(), ep.ClientURLs[0])
if err != nil {
log.Info("failed to get delegate client", errs.ZapError(err))
continue
}
if !s.IsServing() {
// double check
break
}
if s.cluster.SwitchAPIServerLeader(pdpb.NewPDClient(cc)) {
if status.Leader != curLeader {
Expand Down

0 comments on commit b99ba2f

Please sign in to comment.