Repository navigation
SOLR-14718: Failed distributed adds keep their own copy of the add command, so the error names the document - #5091
Open
nick-boss-tech wants to merge 5 commits into
Open
nick-boss-tech wants to merge 5 commits into
nick-boss-tech wants to merge 5 commits into
Conversation
…mmand Hypothetical, unrun regression test; see SOLR-14718-TESTING.md.
nick-boss-tech
marked this pull request as ready for review
October 9, 2026 23:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖 (posted on behalf of Nick Shanin)
https://issues.apache.org/jira/browse/SOLR-14718
What happens today
A failed distributed add can be reported with its document already cleared.
The javabin loader uses one add command for every document in a request. It clears that command after each document (JavabinLoader.java#L105-L123). A distributed add queues its request with that same command object (SolrCmdDistributor.java#L241-L264). When the failure is handled, the error still points at the cleared command. The log then prints
cmd=add{,id=(null)}(error log, Req.toString).What this change does
The request keeps its own copy of the add command, so the error still names the document.
distribAddcopies the command once per call, before it builds the requests. Each request for each node gets that copy (copy, request).Proof
The regression test fails on the base code and passes with the change.
SolrCmdDistributorTest, methodtest(), which now calls a new check,testFailedAddKeepsItsDocumentWhenTheCommandIsReused. With the copy removed (base production code, this test kept), exactly 1 test fails.SolrCmdDistributorTest1/1 passes. Run on 2026-10-07 at head29c09959791a. The module checks pass.Limits
With SOLR-5939 in, each request in a failed merged stream is named against its own document.
f8d4bdbea518, because that code is not on this branch.Changelog:
changelog/unreleased/SOLR-14718-distributor-error-reports-its-document.ymlAI assistance
AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.