sigram opened a new pull request, #5388:
URL: https://github.com/apache/solr/pull/5388

   https://issues.apache.org/jira/browse/SOLR-18687
   
   **Fix CrossDC delete-by-query expansion failing with HTTP 500**
   
   With `solr.crossdc.expandDbq=expand` (the default), the CrossDC producer 
failed every delete-by-query except `*:*` with an HTTP 500 caused by a 
`NullPointerException`. `MirroringUpdateProcessor.processDelete` ran its 
cursorMark query and the follow-up `deleteById` through 
`CoreContainer.getDefaultHttpSolrClient()`. That client has no base URL, so 
building the request URL throws. The delete was not applied on the source 
either, so nothing was deleted or mirrored. The workaround was 
`-Dsolr.crossdc.expandDbq=none`.
   
   The regression came in with SOLR-16503 (`98906f41a5`). Before it, this code 
built its own `HttpSolrClient` pointed at the node's base URL. The refactor 
swapped in the shared default client, which is meant for 
`requestWithBaseUrl(...)`. Nothing caught it because the only real-cluster test 
of expansion (`DeleteByQueryToIdTest.testExpandDBQ`) has been `@Ignore`d since 
the module was absorbed, and the unit tests mock the client.
   
   The fix uses `getZkController().getSolrClient()`, the ZooKeeper-aware 
`CloudSolrClient`, for both the query and the delete-by-id requests.
   
   `MirroringDbqExpansionCloudTest` is new and runs the expansion against a 
real 3-node cluster without Kafka or Docker. It covers `expand`, `none`, the 
default, `*:*` (never expanded), and a delete that needs several cursor pages. 
To plug in a recording factory it adds a `${solr.crossdc.processorFactory:...}` 
property default to the `cloud-minimal` `solrconfig.xml`. Behavior is unchanged 
when the property is unset. Delete requests are sent to random nodes in the 
cluster to eliminate potential bugs related to data locality.
   
   🤖 Generated with Claude Code (Opus 5.5), reviewed and tweaked by an actual 
human ;)
   


-- 
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]

Reply via email to