tboeghk opened a new pull request, #2303: URL: https://github.com/apache/solr/pull/2303
https://issues.apache.org/jira/browse/SOLR-10059 # Description In distributed requests, the appends section of a `RequestHandler` is evaluated not only on the coordinator but also on the shard nodes of the distributed request. This leads to parameters being attached multiple times. This is usually not a problem but if a `fq` parameter that contains a macro is appended on the shard, the request will crash. This is due to the fact that macros are not evaluated during shard requests. ```xml <requestHandler name="/myHandler" class="solr.SearchHandler"> <lst name="appends"> <str name="fq">{!collapse tag=collapsing field=bee_sI sort="${collapseSort}"}</str> </lst> </requestHandler> ``` # Solution This fix will remove all `fq` parameters in shard requests that contain unexpanded macros. Macros should have been expanded on the coordinator. If macros are present in an `fq` parameter they must have been injected in an `appends` block. # Tests This fix contains a Cloud Test that will fail without the proposed fix and unit tests for the `MacroSanitizer`. # Checklist - [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. - [ ] 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) - [x] I have developed this patch against the `main` branch. - [x] I have run `./gradlew check`. - [x] I have added tests for my changes. - [ ] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide) -- 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: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org