Skip to content

Commit

Permalink
server: busy loop through resolver list during join process
Browse files Browse the repository at this point in the history
Deferred doing this in #52526. Probably a good idea to do have it, it'll
bring down the cluster convergence time (time taken for all nodes to
find out about the initialization) by a bit.

Release justification: low risk, high benefit changes to existing functionality
Release note: None
  • Loading branch information
irfansharif committed Aug 31, 2020
1 parent 42e73f7 commit 6aa2985
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/server/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,24 @@ func (s *initServer) startJoinLoop(ctx context.Context, stopper *stop.Stopper) e
return ErrJoinRPCUnsupported
}

// Busy-loop through all the resolvers at least once. Keep this code block
// roughly in sync with the one below.
for _, res := range s.config.resolvers {
addr := res.Addr()
err := s.attemptJoin(ctx, addr)
if err == nil {
return nil
}

if errors.Is(err, ErrJoinRPCUnsupported) || errors.Is(err, ErrIncompatibleBinaryVersion) {
// Propagate upwards; these are error conditions the caller knows to
// expect.
return err
}

// Ignore all other errors, they'll be better dealt with below.
}

const joinRPCBackoff = time.Second
var tickChan <-chan time.Time
{
Expand Down

0 comments on commit 6aa2985

Please sign in to comment.