-
Notifications
You must be signed in to change notification settings - Fork 15
[PDS-127121] Log refreshed Cassandra hosts at info level #4917
Conversation
Generate changelog in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may end up being closer to once per second on atlasdb-proxy. I'm fine either way, have a suggestion that might reduce the noise a bit
@@ -312,7 +312,7 @@ private void setServersInPoolTo(Set<InetSocketAddress> desiredServers) { | |||
cassandra.refreshTokenRangesAndGetServers(); | |||
} | |||
|
|||
log.debug("Cassandra pool refresh added hosts {}, removed hosts {}.", | |||
log.info("Cassandra pool refresh added hosts {}, removed hosts {}.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: How valuable is an empty refresh line? Maybe we can have a refresh that did something at INFO and a refresh that did nothing at DEBUG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
logRefreshedHosts(serversToAdd, serversToRemove); | ||
} | ||
|
||
private void logRefreshedHosts(Set<InetSocketAddress> serversToAdd, Set<InetSocketAddress> serversToRemove) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: static?
Goals (and why):
Expose more information about the state of the Cassandra pool in logs.
Implementation Description (bullets):
Changed
DEBUG
->INFO
on one log line (that details which hosts that have been added and removed).Testing (What was existing testing like? What have you done to improve it?):
N/A.
Concerns (what feedback would you like?):
I don't think this introduces much spam - it is unlikely that anyone refreshes their token ranges / servers more than once per 30 seconds (default is once per 120 seconds), so one log line per refresh is minimal.
As for whether this is enough - I believe so, as it would tell us what hosts that are being added/removed at each point so that we can have a reasonable picture of what the pool is. Naturally this doesn't tell us the actual current state of the pool, only the diff - but
debugLogStateOfPool
is a lot more heavy-handed, and possibly not necessary here.Where should we start reviewing?:
CassandraClientPoolImpl
Priority (whenever / two weeks / yesterday):
Whenever