gerlowskija opened a new pull request, #5173: URL: https://github.com/apache/solr/pull/5173
# Description Prior to this commit, IndexFetcher's "slowFileExists" method checked existence by attempting to open and then close the file. When MMapDirectoryFactory was in use, this "open" creates an mmap that remains somewhat "leaked" until the DirectoryReader is closed, due to idiosyncracies in how Lucene pools mmaps into "arenas" based on their segment. This caused a pretty significant mmap leak in later Solr 9.x releases. It's less likely to impact Solr 10.x or later versions due to changes in Lucene, but it's still possible. # Solution This commit fixes the issue by reworking IndexFetcher's "exists" check. Now instead of opening the file, IndexFetcher does a size-check which can be used to determine existence with only an OS 'stat' call and without creating an mmap at all. # Tests None. I'd like to write tests here, but I can't think of a good way to write an automated test for this. If anyone has ideas I'm very open to suggestions! # 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. - [ ] I have run `./gradlew check`. - [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]
