kotman12 opened a new pull request, #4974: URL: https://github.com/apache/solr/pull/4974
https://issues.apache.org/jira/browse/SOLR-18480 # AI Usage I used Opus 5/5.5 to iterate on a solution for this. There were probably tens if not hundreds of refinements. # Description During leader election a new leader will try to tear down its index fetcher. If the old leader process has stalled, this tear-down can take the minimum of graceful executor timeout and socket timeout (in our configuration it stalls for 60s). Since there is no point in gracefully shutting down an index fetch request that gets discarded anyway I propose we tear it down eagerly without waiting. We have observed this issue in the wild and were lucky enough to reproduce it here. # Solution Equip the `HttpJettySolrClient` with an eager `abort` that doesn't wait. I only implemented it for the jetty client as it appears to be the only client with robust request tracking support (and the only client currently relevant to `IndexFetcher`). I create a thin client for each individual fetch so as to isolate what gets aborted. I also added an opt-in for tracking synchronous requests since IndexFetcher primarily uses this mode. I see no reason tracking of synchronous requests this shouldn't at least be an option. Although it would be nice to see if we can simply _always_ track sync requests (i.e. if the performance penalty for this is small) but I didn't have time to properly benchmark this. Because the consequence is so far-reaching I have left it as an opt-in. # Tests Mainly in TlogLeaderElectionFrozenLeaderTest # Checklist Please review the following and check all that apply: - [x] I have reviewed the guidelines for [How to Contribute](https://github.com/apache/solr/blob/main/CONTRIBUTING.md) and my code conforms to the standards described there to the best of my ability. - [x] I have created a Jira issue and added the issue ID to my pull request title. - [x] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation) - [x] I have developed this patch against the `main` branch. - [x] I have run `./gradlew check`. - [x] I have added tests for my changes. - [x] I have added a [changelog entry](https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc) for my change -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
