SOLR-13953: Update eviction behavior of cache in Solr Prometheus exporter to allow for larger clusters #1022
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Email thread starts here: http://mail-archives.apache.org/mod_mbox/lucene-dev/201911.mbox/%3cCAOz296DSV-tt7rWBirBZ+P4=vT5g29FZrR_2zHrHF084Xq+gyw@mail.gmail.com%3e . Jira issue here: https://issues.apache.org/jira/browse/SOLR-13953
For large (> 100 node) clusters, the exporter fails with "connection pool shut down" for certain nodes. This is caused by only the last 100 HttpSolrClients added to the cache still being open -- earlier additions are evicted and closed, even though the HttpSolrClients are still returned for use in
metricsForAllHosts
andpingAllCollections
.Solution
Change the cache configuration to evict clients from the cache after twice the scrape interval, instead of using a fixed size cache.
Would love opinions on:
Tests
Can add a regression test if it seems valuable, but with past configuration, would need to be with > 100 nodes.
Checklist
Please review the following and check all that apply:
master
branch.ant precommit
and the appropriate test suite.