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

   🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*
   
   https://issues.apache.org/jira/browse/SOLR-12245
   
   ## What happens today
   
   **A failed distributed update reports its message only. It does not say 
which replica it was sent to.**
   
   When a distributed update fails asynchronously, the error reads "Async 
exception during distributed update:" followed by the message. The text does 
not name the replica, collection or shard that the request was sent to.
   
   ## What this change does
   
   **The error names the replica, collection and shard. A remote error does not 
repeat the host.**
   
   - When the request has a target node, the error adds "(while sending to 
...)". It holds the replica URL, then `collection=` and `shard=` when they are 
known 
([describe](https://github.com/nick-boss-tech/solr/blob/f325d5d0576e582d4488570eabdeabc7410a8a0f/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java#L1243-L1269)).
   - A remote error already names its server in its own message. For that case 
the suffix uses the core name, so the host appears once ([host 
check](https://github.com/nick-boss-tech/solr/blob/f325d5d0576e582d4488570eabdeabc7410a8a0f/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java#L1254-L1261)).
   - The server's own message is kept as it was.
   - The single-error and multi-error forms both use this text 
([build](https://github.com/nick-boss-tech/solr/blob/f325d5d0576e582d4488570eabdeabc7410a8a0f/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java#L1299-L1307)).
   - Behavior change: asynchronous distributed update errors with a target node 
get a longer message. Code that matches the old text exactly will see a 
different message.
   
   ## Proof
   
   **The host-once test fails before this fix and passes with it.**
   
   - The fail-before test is 
[`testDistribErrorMessageNamesTheHostOnce`](https://github.com/nick-boss-tech/solr/blob/f325d5d0576e582d4488570eabdeabc7410a8a0f/solr/core/src/test/org/apache/solr/update/processor/DistributedUpdateProcessorTest.java#L215-L240).
 The fix commit `f325d5d0576e` added it. Run with the head test class against 
the pre-fix production code at `4a93167458b`, it fails. There the full URL is 
always added, so the host appears twice when the server's message already names 
it.
   - The other new check is 
[`testDistribErrorMessageNamesTheTargetReplica`](https://github.com/nick-boss-tech/solr/blob/f325d5d0576e582d4488570eabdeabc7410a8a0f/solr/core/src/test/org/apache/solr/update/processor/DistributedUpdateProcessorTest.java#L155-L212).
 It checks that the replica URL, collection and shard appear in the error. It 
is not the fail-before test.
   - `DistributedUpdateProcessorTest` 6 of 6 pass with this change.
   - Verified 2026-10-09 at this head.
   
   ## A choice to check
   
   **The replica name goes in the error text. The other route keeps it in the 
logs only.**
   
   The other route keeps the error text as it was and writes the replica detail 
to the logs. A client would then see no replica name in the error. This branch 
puts the name in the error itself.
   
   Was putting the replica in the error text the right call, or should it go to 
the logs only?
   
   ## Limits
   
   - The ticket's MDC ask is not addressed by this change. It is offered as a 
follow-up ticket and PR, on request.
   - Null-guard coverage is not included in this change. No test covers a null 
guard.
   - The tests build the error by hand. They do not run a failing distributed 
update.
   - An error with no target node keeps the old text. No replica is named for 
it.
   
   Changelog: 
`changelog/unreleased/SOLR-12245-distrib-update-error-names-replica.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