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

Do not throw a warning for zero token nodes #324

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,8 @@ func (c *Conn) awaitSchemaAgreement(ctx context.Context) error {
if !isValidPeer(host) || host.schemaVersion == "" {
c.logger.Printf("invalid peer or peer with empty schema_version: peer=%q", host)
continue
} else if isZeroToken(host) {
continue
}

versions[host.schemaVersion] = struct{}{}
Expand Down
9 changes: 7 additions & 2 deletions host_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,8 @@ func (r *ringDescriber) getClusterPeerInfo(localHost *HostInfo) ([]*HostInfo, er
r.session.logger.Printf("Found invalid peer '%s' "+
"Likely due to a gossip or snitch issue, this host will be ignored", host)
continue
} else if isZeroToken(host) {
continue
}

peers = append(peers, host)
Expand All @@ -861,8 +863,11 @@ func isValidPeer(host *HostInfo) bool {
return !(len(host.RPCAddress()) == 0 ||
host.hostId == "" ||
host.dataCenter == "" ||
host.rack == "" ||
len(host.tokens) == 0)
host.rack == "")
}

func isZeroToken(host *HostInfo) bool {
return len(host.tokens) == 0
}

// GetHosts returns a list of hosts found via queries to system.local and system.peers
Expand Down
Loading