Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
[PDS-127121] Log refreshed Cassandra hosts at info level (#4917)
Browse files Browse the repository at this point in the history
* set debug logging to info

* Add generated changelog entries

* factor out log method

* make method static
  • Loading branch information
Jolyon-S authored Jul 28, 2020
1 parent c29a52f commit 52e8a91
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,17 @@ private void setServersInPoolTo(Set<InetSocketAddress> desiredServers) {
cassandra.refreshTokenRangesAndGetServers();
}

log.debug("Cassandra pool refresh added hosts {}, removed hosts {}.",
SafeArg.of("serversToAdd", CassandraLogHelper.collectionOfHosts(serversToAdd)),
SafeArg.of("serversToRemove", CassandraLogHelper.collectionOfHosts(serversToRemove)));
logRefreshedHosts(serversToAdd, serversToRemove);
}

private static void logRefreshedHosts(Set<InetSocketAddress> serversToAdd, Set<InetSocketAddress> serversToRemove) {
if (serversToRemove.isEmpty() && serversToAdd.isEmpty()) {
log.debug("No hosts added or removed during Cassandra pool refresh");
} else {
log.info("Cassandra pool refresh added hosts {}, removed hosts {}.",
SafeArg.of("serversToAdd", CassandraLogHelper.collectionOfHosts(serversToAdd)),
SafeArg.of("serversToRemove", CassandraLogHelper.collectionOfHosts(serversToRemove)));
}
}

private Set<InetSocketAddress> getCachedServers() {
Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-4917.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Log refreshed Cassandra hosts at info level instead of debug.
links:
- https://github.com/palantir/atlasdb/pull/4917

0 comments on commit 52e8a91

Please sign in to comment.