Repository navigation
SOLR-16130: Add cross-collection export regression test - #5004
Open
nick-boss-tech wants to merge 3 commits into
Open
nick-boss-tech wants to merge 3 commits into
nick-boss-tech wants to merge 3 commits into
Conversation
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-16130
What happens today
The reported symptom: a cross-collection join returns no documents when the from-collection's
/exportresult ends with a segment that has no matches. The root cause (a null per-leaf bitset reachingExportWriter.topDocs()) was fixed and merged in #4953 (SOLR-8291). This PR contains no production change; it adds the regression test for the reported scenario, which nothing covered.What this change does
CrossCollectionJoinQueryTest.testCcJoinWithTrailingUnmatchedExportSegmentindexes matching documents, commits, then indexes non-matching documents and commits again, producing the trailing unmatched segment, and asserts the cross-collection join returns the 4 matching documents. The test also asserts that the from core still holds at least two segments (one per commit, so the layout the scenario needs cannot silently merge away) and that the returned documents are exactly the four expected ids (to-0throughto-3). The ccjoin test configset enablesuseFilterForSortedQuery, which routes/exportthrough thesortDocSetpath that skipsgetLeafCollectorfor trailing unmatched leaves (the path from the #4953 analysis). OnlyCrossCollectionJoinQueryTestuses that configset. EnablinguseFilterForSortedQueryin that configset changes the configuration for every test in the class, not just the new one: the whole class now runs with the filter path on.Proof
Verified at head 3c48dec on 2026-10-06 (tidy clean, Error Prone compile clean,
:solr:core:check -x testgreen; GitHub Actions corroboration run 37581056636 dispatched for the class at this head).70c1a28995d(the parent of the SOLR-8291, SOLR-13217: Skip null per-leaf export bitsets #4953 guard commit56ec140e363) with only this PR's test and configset applied: the new test fails, and the server log records exactly the null-bitset error the guard prevents:java.lang.NullPointerException: Cannot invoke "org.apache.lucene.util.BitSet.length()" because "bits" is nullatExportWriter$SegmentIterator.topDocs; the broken export stream then fails the join query withSolrServerException: No live SolrServers available to handle this request. With the guard (already on main),CrossCollectionJoinQueryTestpasses 10/10, the new test included.Limits
The test covers the one reported scenario: a trailing unmatched export segment on the sorted export path. Other export and join shapes are covered by the existing suite, not by this test. The fix itself is not in this PR; it merged separately in #4953.
AI assistance
AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.