Skip to content
Open
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: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
4.0.22
* Avoid DNS lookup for hostname column in ClientsTable and GossipInfoTable (CASSANDRA-21539)
* During streaming Bounds.getNonOverlappingBounds produces incorrect bounds leading to row/counter cache not invalidate correctly (CASSANDRA-21594)
* Make runWithCompactionsDisabled return non-null on success (CASSANDRA-21527)
* Validate authz before performing role check in LIST ROLES/PERMISSIONS (CASSANDRA-21560)
* Ensure transferred_ranges reset on decommision re-attempt when pending ranges cannot be proven continous (CASSANDRA-16290)
* Add validation to uncompressed length during decompression (CASSANDRA-21567)
* Fix regression in PasswordObfuscator for dollar-quoted passwords (CASSANDRA-21559)
* Do not make DNS lookup when querying system_views.clients for hostname column by removing it (CASSANDRA-21539)
* Fix memtable on-heap accounting drift in BTree.update and BTreeRow.merge (CASSANDRA-21472)
* Include missing cassandra-jaas.config file in Debian package (CASSANDRA-19750)

Expand Down
3 changes: 3 additions & 0 deletions NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Upgrading
- This release addresses a security vulnerability in the LZ4 dependency, documented in CASSANDRA-21052. For users
who did not use LZ4 native libraries, this will now fallback to a safer but less performant pure Java
implementation. During startup, a warning will be logged if the LZ4 native library is not available.
- The hostname column in system_views.clients will no longer perform a reverse DNS lookup and will instead
return the same value as the address column. This avoids the risk of client connections overwhelming
DNS. (CASSANDRA-21539)

4.0.14
======
Expand Down
19 changes: 10 additions & 9 deletions doc/modules/cassandra/pages/new/virtualtables.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ We shall discuss some of the virtual tables in more detail next.

The `clients` virtual table lists all active connections (connected
clients) including their ip address, port, connection stage, driver
name, driver version, protocol version, request count, ssl
name, driver version, hostname, protocol version, request count, ssl
enabled, ssl protocol and user name:

....
cqlsh:system_views> select * from system_views.clients;
address | port | connection_stage | driver_name | driver_version | protocol_version | request_count | ssl_cipher_suite | ssl_enabled | ssl_protocol | username
-----------+-------+------------------+-------------+----------------+------------------+---------------+------------------+-------------+--------------+-----------
127.0.0.1 | 50628 | ready | null | null | 4 | 55 | null | False | null | anonymous
127.0.0.1 | 50630 | ready | null | null | 4 | 70 | null | False | null | anonymous
address | port | connection_stage | driver_name | driver_version | hostname | protocol_version | request_count | ssl_cipher_suite | ssl_enabled | ssl_protocol | username
-----------+-------+------------------+-------------+----------------+-----------+------------------+---------------+------------------+-------------+--------------+-----------
127.0.0.1 | 50628 | ready | null | null | localhost | 4 | 55 | null | False | null | anonymous
127.0.0.1 | 50630 | ready | null | null | localhost | 4 | 70 | null | False | null | anonymous

(2 rows)
....
Expand All @@ -139,6 +139,7 @@ CREATE TABLE system_views.clients (
connection_stage text,
driver_name text,
driver_version text,
hostname text,
port int,
protocol_version int,
request_count bigint,
Expand Down Expand Up @@ -400,10 +401,10 @@ cqlsh> SELECT * FROM clients LIMIT 2;

[source, cql]
----
address | port | connection_stage | driver_name | driver_version | protocol_version | request_count | ssl_cipher_suite | ssl_enabled | ssl_protocol | username
-----------+-------+------------------+------------------------+----------------+------------------+---------------+------------------+-------------+--------------+-----------
127.0.0.1 | 37308 | ready | DataStax Python Driver | 3.21.0.post0 | 4 | 17 | null | False | null | anonymous
127.0.0.1 | 37310 | ready | DataStax Python Driver | 3.21.0.post0 | 4 | 8 | null | False | null | anonymous
address | port | connection_stage | driver_name | driver_version | hostname | protocol_version | request_count | ssl_cipher_suite | ssl_enabled | ssl_protocol | username
-----------+-------+------------------+------------------------+----------------+-----------+------------------+---------------+------------------+-------------+--------------+-----------
127.0.0.1 | 37308 | ready | DataStax Python Driver | 3.21.0.post0 | localhost | 4 | 17 | null | False | null | anonymous
127.0.0.1 | 37310 | ready | DataStax Python Driver | 3.21.0.post0 | localhost | 4 | 8 | null | False | null | anonymous

(2 rows)
----
3 changes: 3 additions & 0 deletions src/java/org/apache/cassandra/db/virtual/ClientsTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ final class ClientsTable extends AbstractVirtualTable
{
private static final String ADDRESS = "address";
private static final String PORT = "port";
private static final String HOSTNAME = "hostname";
private static final String USERNAME = "username";
private static final String CONNECTION_STAGE = "connection_stage";
private static final String PROTOCOL_VERSION = "protocol_version";
Expand All @@ -47,6 +48,7 @@ final class ClientsTable extends AbstractVirtualTable
.partitioner(new LocalPartitioner(InetAddressType.instance))
.addPartitionKeyColumn(ADDRESS, InetAddressType.instance)
.addClusteringColumn(PORT, Int32Type.instance)
.addRegularColumn(HOSTNAME, UTF8Type.instance)
.addRegularColumn(USERNAME, UTF8Type.instance)
.addRegularColumn(CONNECTION_STAGE, UTF8Type.instance)
.addRegularColumn(PROTOCOL_VERSION, Int32Type.instance)
Expand All @@ -69,6 +71,7 @@ public DataSet data()
InetSocketAddress remoteAddress = client.remoteAddress();

result.row(remoteAddress.getAddress(), remoteAddress.getPort())
.column(HOSTNAME, remoteAddress.getHostString())
.column(USERNAME, client.username().orElse(null))
.column(CONNECTION_STAGE, client.stage().toString().toLowerCase())
.column(PROTOCOL_VERSION, client.protocolVersion())
Expand Down