SOLR-17160: Time based tracking of core admin requests#2271
Closed
psalagnac wants to merge 1 commit intoapache:mainfrom
Closed
SOLR-17160: Time based tracking of core admin requests#2271psalagnac wants to merge 1 commit intoapache:mainfrom
psalagnac wants to merge 1 commit intoapache:mainfrom
Conversation
dsmiley
reviewed
Feb 21, 2024
Contributor
dsmiley
left a comment
There was a problem hiding this comment.
Instead of the manual cache management, can't we use CaffeineCache as is used elsewhere in Solr? CC @bruno-roustant
7 tasks
Contributor
Author
Thanks for the suggestion. I filled #2304 that achieves the same, with a Caffeine cache. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://issues.apache.org/jira/browse/SOLR-17160
Description
Core admin completed/failed requests are tracked in-memory, but we only track a maximum of 100 requests by dropping the oldest ones. If for any reason we drop a request before the client (an other Solr node) fetched the status, we will get unexpected errors at the top level command.
Solution
Instead of the hard limit of 100 tracked requests, we track all requests with a expiration timeout. This is a trade-off to not keep memory forever and to be sure we won't lose status in the case of many incoming requests.
The change adds two different timeouts:
"solr.admin.requests.running.timeout.minutes")"solr.admin.requests.completed.timeout.minutes")Tests
Added a unit test in
CoreAdminHandlerTestto check expired requests are not tracked in-memory anymore.Also checks we don't have any issue for collection backup with very high numbers of shards.
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.