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

[PDS-127121] Log refreshed Cassandra hosts at info level #4917

Merged
merged 5 commits into from
Jul 28, 2020

Conversation

Jolyon-S
Copy link
Contributor

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

@changelog-app
Copy link

changelog-app bot commented Jul 27, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Log refreshed Cassandra hosts at info level instead of debug.

Check the box to generate changelog(s)

  • Generate changelog entry

@Jolyon-S Jolyon-S requested a review from jeremyk-91 July 27, 2020 13:41
Copy link
Contributor

@jeremyk-91 jeremyk-91 left a 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 {}.",
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it.

@Jolyon-S Jolyon-S requested a review from jeremyk-91 July 27, 2020 14:17
logRefreshedHosts(serversToAdd, serversToRemove);
}

private void logRefreshedHosts(Set<InetSocketAddress> serversToAdd, Set<InetSocketAddress> serversToRemove) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: static?

@bulldozer-bot bulldozer-bot bot merged commit 52e8a91 into develop Jul 28, 2020
@bulldozer-bot bulldozer-bot bot deleted the elevate-to-info branch July 28, 2020 10:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants