Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always refresh ring on topology changes and reconnections #1680

Merged
merged 7 commits into from
Apr 25, 2023
Merged
Prev Previous commit
Next Next commit
Remove addNewNode function (unused)
  • Loading branch information
joao-r-reis committed Apr 11, 2023
commit a841c1d66b3af338fcd1c79467bff27f37bc8630
28 changes: 0 additions & 28 deletions events.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,34 +194,6 @@ func (s *Session) handleNodeEvent(frames []frame) {
}
}

func (s *Session) addNewNode(hostID UUID) {
// Get host info and apply any filters to the host
hostInfo, err := s.hostSource.getHostInfo(hostID)
if err != nil {
s.logger.Printf("gocql: events: unable to fetch host info for hostID: %q: %v\n", hostID, err)
return
} else if hostInfo == nil {
// ignore if it's null because we couldn't find it
return
}

if t := hostInfo.Version().nodeUpDelay(); t > 0 {
time.Sleep(t)
}

// should this handle token moving?
hostInfo = s.ring.addOrUpdate(hostInfo)

if !s.cfg.filterHost(hostInfo) {
s.startPoolFill(hostInfo)
}

if s.control != nil && !s.cfg.IgnorePeerAddr {
// TODO(zariel): debounce ring refresh
s.hostSource.refreshRing()
}
}

func (s *Session) handleNodeUp(eventIp net.IP, eventPort int) {
if gocqlDebug {
s.logger.Printf("gocql: Session.handleNodeUp: %s:%d\n", eventIp.String(), eventPort)
Expand Down