Repository navigation
[Ready] SOLR-7498: A stream with an unknown size gets no stream_size value. A known size is still recorded - #5137
Draft
nick-boss-tech wants to merge 6 commits into
Draft
nick-boss-tech wants to merge 6 commits into
nick-boss-tech wants to merge 6 commits into
Conversation
…ze is unknown Hypothetical, unrun regression test; see SOLR-7498-TESTING.md.
nick-boss-tech
marked this pull request as ready for review
October 16, 2026 06:47
stream_size value. A known size is still recordedstream_size value. A known size is still recorded
nick-boss-tech
marked this pull request as draft
October 28, 2026 04:44
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)
Ready for review, but held as a draft due to the project's open-PR cap; I'll mark it open on request.
https://issues.apache.org/jira/browse/SOLR-7498
What happens today
The extracting handler can store the text "null" as
stream_size, and the numeric field then rejects the document.When the size of an uploaded stream is not known,
ContentStream.getSize()returns null (ContentStream.java L39 at base). The loader passes that null on as the request's stream size (ExtractingDocumentLoader.java L139 at base). The metadata builder then calledString.valueOfon it, so the metadata held the textnull(ExtractionBackend.java L55 at base).The ticket reports
Error adding field 'stream_size'='null' msg=For input string: "null"from a SolrJContentStreamUpdateRequestupload. The reporter says Solr's post tool works, because it sends a numeric size.What this change does
A stream with an unknown size gets no
stream_sizevalue. A known size is still recorded.buildMetadataFromRequestaddsstream_sizeonly when the request has a size (ExtractionBackend.java L55-L58). Any non-null size is kept, zero included.Behavior change: a document from a stream of unknown size no longer carries
stream_size. It used to carry the textnull.Proof
One new test fails on the base code and passes with the change. The other two classes in the module pass and are not changed.
ExtractionBackendMetadataTest2 of 2 at2050d8e447a733966d5f6e4742a1a8ea931a2b00, verified 2026-10-05. On the base code,testUnknownStreamSizeIsNotAddedfails because the metadata holds the textnull.testKnownStreamSizeIsAddedpasses on both.XmlSanitizingReaderTest2 of 2 andExtractingRequestHandlerPermissionTest6 of 6 at the same head. This patch does not change them.Limits
The test checks the metadata builder. It does not send an upload through the handler.
/update/extract. The cause of the unknown size in the reporter's upload was not traced. An end-to-end test is not in this PR. A PR for it can be opened on request.nullkeep it. Reindexing them is the fix for those documents.Changelog:
changelog/unreleased/SOLR-7498-extract-null-stream-size.yml(type: fixed)AI assistance
AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.