solr
solr copied to clipboard
SOLR-17413: ulog replay should copy SolrQueryRequest
Description
SolrQueryRequest is a non-threadsafe type, but was being shared across executor threads during UpdateLog replay. This introduces a number of issues, not the least being a ConcurrentModificationException if multiple threads happen to tweak the request 'context' simultaneously.
Solution
This commit fixes this issue by giving each executor thread a unique LocalSolrQueryRequest instance to use.
Tests
The problem is reproducible (on my hardware at least) via 'beasting' BasicDistributedZkTest
for several hundred iterations but is otherwise hard to trigger. The test passes reliably with this fix, which can give us some confidence I think. Though if anyone can think of a better way to capture this in an automated test, I'd love to get some additional validation!
Checklist
Please review the following and check all that apply:
- [x] I have reviewed the guidelines for How to Contribute 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 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
. - [ ] I have added tests for my changes.