nick-boss-tech opened a new pull request, #5092:
URL: https://github.com/apache/solr/pull/5092

   🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*
   
   https://issues.apache.org/jira/browse/SOLR-16356
   
   ## What happens today
   
   **A delete-by-query on a closing core logs an ERROR with a stack trace.**
   
   A delete-by-query can ask the update log to open a new realtime searcher 
([UpdateLog.java](https://github.com/nick-boss-tech/solr/blob/39c0585072f0eacc0767a173bab3f1d528db64f7/solr/core/src/java/org/apache/solr/update/UpdateLog.java#L919-L925)).
 When the core is already closed, that open fails with a closed-core exception. 
The update log logs "Error opening realtime searcher" at ERROR with the stack 
trace ([catch 
block](https://github.com/nick-boss-tech/solr/blob/39c0585072f0eacc0767a173bab3f1d528db64f7/solr/core/src/java/org/apache/solr/update/UpdateLog.java#L953-L955)).
 The core is closing, so no new searcher can open. The ERROR is logged anyway.
   
   ## What this change does
   
   **A closed-core failure is logged at debug, not ERROR, in two places in the 
update log.**
   
   - In `openRealtimeSearcher`, the closed-core exception is logged at debug, 
and the method returns. The id caches are kept, as for any other failure 
([lines](https://github.com/nick-boss-tech/solr/blob/39c0585072f0eacc0767a173bab3f1d528db64f7/solr/core/src/java/org/apache/solr/update/UpdateLog.java#L949-L952)).
   - In `deleteAll`, the same exception is logged at debug. The method then 
clears its caches as before. The code comment marks `deleteAll` as for testing 
only 
([lines](https://github.com/nick-boss-tech/solr/blob/39c0585072f0eacc0767a173bab3f1d528db64f7/solr/core/src/java/org/apache/solr/update/UpdateLog.java#L964-L971)).
   
   Any other failure still logs at ERROR.
   
   ## Proof
   
   **The new test fails without the fix and passes with it.**
   
   - 
`UpdateLogClosedCoreTest.testOpeningRealtimeSearcherOnClosedCoreIsNotAnError` 
([test](https://github.com/nick-boss-tech/solr/blob/39c0585072f0eacc0767a173bab3f1d528db64f7/solr/core/src/test/org/apache/solr/update/UpdateLogClosedCoreTest.java#L31-L42)).
 Pre-fix proof: PASS, as recorded in the gate entry.
   - Gate run on 2026-10-04 at head `39c0585072f0`: `UpdateLogClosedCoreTest` 
1/1 passes, and `UpdateLogTest` 5/5 passes. Module check rc=0.
   
   ## Limits
   
   **A second close-time ERROR is not fixed here.**
   
   - The ticket's transcript includes a second close-time ERROR. It comes from 
the periodic task in `DocExpirationUpdateProcessorFactory`, which commits after 
its delete-by-query. This branch does not change that path. I can open a 
follow-up to trace that commit on request.
   - The two classes above are the tests run for this change.
   
   Changelog: `changelog/unreleased/SOLR-16356.yml`
   
   ### AI assistance
   
   AI agents assisted with research, implementation, review, and drafting. Nick 
Shanin directed the work and takes responsibility for this contribution.
   


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