Skip to content

CASSANDRA-21539: Remove hostname from ClientsTable and GossipInfoTable to avoid reverse-DNS lookups - #4971

Open
nivykani wants to merge 2 commits into
apache:trunkfrom
nivykani:dns
Open

CASSANDRA-21539: Remove hostname from ClientsTable and GossipInfoTable to avoid reverse-DNS lookups#4971
nivykani wants to merge 2 commits into
apache:trunkfrom
nivykani:dns

Conversation

@nivykani

@nivykani nivykani commented Jul 28, 2026

Copy link
Copy Markdown

The current code uses getHostName(), which has the known effect: This method may trigger a name service reverse lookup if the address was created with a literal IP address. This field in both ClientsTable and GossipInfoTable was constructed with addresses to begin with, not names, so getHostName() was always doing a blocking reverse-DNS lookup on row reads for the first call.

This is a potentially slow blocking call, and we want to avoid doing any DNS lookups here because repeatedly querying this table could potentially overwhelm DNS, especially with frequently-changing client connections.

We could instead use getHostName, but the primary key of both ClientsTable and GossipInfoTable is (address, port), where address is type inet. Thus, this field is redundant.

To the best of my searching, no in-repo consumer depends on this column having a resolved name (and instead use an address-only path), and nodetool clientstats already doesn't display the hostname column.

The Cassandra Jira

@nivykani nivykani changed the title CASSANDRA-21539: Replace getHostName with getHostString to avoid reverse-DNS lookups CASSANDRA-21539: Remove hostname from ClientsTable and GossipInfoTable to avoid reverse-DNS lookups Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant