Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17160: Time based tracking of core admin requests #2271

Closed
wants to merge 1 commit into from

Conversation

psalagnac
Copy link
Contributor

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:

  • an hour for every requests (overridable with property "solr.admin.requests.running.timeout.minutes")
  • 5 minutes for completed/failed requests once the status is already retrieved by client (overridable with property "solr.admin.requests.completed.timeout.minutes")

Tests

Added a unit test in CoreAdminHandlerTest to 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:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

Instead of the manual cache management, can't we use CaffeineCache as is used elsewhere in Solr? CC @bruno-roustant

@psalagnac
Copy link
Contributor Author

Instead of the manual cache management, can't we use CaffeineCache as is used elsewhere in Solr? CC @bruno-roustant

Thanks for the suggestion. I filled #2304 that achieves the same, with a Caffeine cache.

@dsmiley dsmiley closed this Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants