Skip to content

SOLR-13696: Category and Dimensional routed-alias test suites run again, with a create-alias fix and a time-route fix - #5088

Open
nick-boss-tech wants to merge 16 commits into
apache:mainfrom
nick-boss-tech:solr-13696-submit
Open

nick-boss-tech wants to merge 16 commits into
apache:mainfrom
nick-boss-tech:solr-13696-submit

Conversation

@nick-boss-tech

@nick-boss-tech nick-boss-tech commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖 (posted on behalf of Nick Shanin)

https://issues.apache.org/jira/browse/SOLR-13696

What happens today

The Category and Dimensional routed-alias update tests are skipped. When the skip is removed, they fail.

Both suites extend RoutedAliasUpdateProcessorTest, which is skipped for this ticket. Un-skipping shows five problems:

  • The create-alias message for a dimensional alias has no top-level router name or field.
  • The Dimensional tests use a fixed "future" date, 2020-10-23, which has passed. The router creates daily collections toward it until the client times out.
  • The placement check reads [shard] in its default style, which returns a bare shard id at luceneMatchVersion 9.5.
  • A document whose timestamp is still a string throws ClassCastException in TimeRoutedAlias.formattedRouteValues.
  • Each test method creates a cluster, but only the last one is shut down.

What this change does

The two suites run again, their tests are repaired, and two production defects are fixed.

  • The @AwaitsFix on the base class is removed. The base keeps its @Ignore, since it is abstract.
  • addDocsAndCommit commits each collection explicitly instead of using commitWithin.
  • Each test method shuts down its own cluster in @After.
  • The category test uses ship_name_s. The "future" document is built 30 days after now, and the placement check asks for [shard] in URL style.
  • Create-alias fix: a dimensional alias message carries the top-level router name (Dimensional[TIME,CATEGORY] form) and the comma-joined router field, the shape SolrJ already sends.
  • Time-route fix: formattedRouteValues parses the value with parseRouteKey instead of casting it to Date. Only dimensional aliases call it.

Proof

The focused suites pass at head 960355fce3, and each repair fails without its fix.

The counts below were measured at da4fa6df11, before the SOLR-13059 test fixes. At 6914eae1c2 the other routed-alias suites passed in normal mode. 960355fce3 changes only the TimeRouted test file and a test-only hook in production (see Choices), and the TimeRouted class passes in normal mode. Receipt: receipts/SOLR-13059.md on coordination.

  • CategoryRoutedAliasUpdateProcessorTest 6 of 6, DimensionalRoutedAliasUpdateProcessorTest 2 of 2, CreateAliasAPITest 13 of 13. Module checks pass.
  • Run without its fix, each repair fails: the time-route fix at 98ad9d3fcc, the future-date and [shard] repairs at a4e0da4223 and 08f9384e47, and the create-alias fix on base c3cdf7b46e (both Dimensional tests fail at CREATEALIAS).

Behavior change

Two requests that fail on main now succeed. Both paths are reached only by dimensional aliases.

  • V2 create-alias, dimensional alias: the router name and field are sent in the SolrJ shape. Single-router aliases are unchanged.
  • Time route with a string timestamp: formattedRouteValues accepts ISO-8601 strings through parseRouteKey. Instant and Date values behave as before. A string that is not ISO-8601 now fails in the parser instead of with ClassCastException.

Choices for maintainers

Two decisions need a maintainer's call.

  1. Should the V2 create-alias API accept dimensional aliases? This PR: yes, in the SolrJ shape. Alternative: keep rejecting them, and the Dimensional fixture creates its alias another way.

  2. Should a time-routed document with a string timestamp be parsed or rejected? This PR: parse it as ISO-8601, with the parser the class already uses on another path. Alternative: return a 400 that names the field.

  3. Should preemptive creation have a test hold, so the test can prove that creation is asynchronous? This PR: yes, one hook. TestInjection gets a latch that is null unless a test arms it, and RoutedAlias.preemptiveAsync waits on it (bounded at 30 seconds) before creating. In production the hook does nothing. Alternative: keep the timing-based check, which cannot tell synchronous creation from asynchronous creation.

Our recommendation: the choices in this PR for all three. Choice 1 matches the SolrJ create path, choice 2 reuses the existing parser, and choice 3 is the only way the test can prove asynchrony without timing.

Limits

  • TimeRoutedAliasUpdateProcessorTest is no longer class-skipped for SOLR-13059. testDateMathInStart keeps its method-level @AwaitsFix(SOLR-13943), which PR 5089 handles.
  • The routed-alias tests no longer use commitWithin. An explicit commit goes through the same searcher path, so little coverage is lost. The alternative is an honest commitWithin check in the re-enabled tests, which this PR does not add. Maintainers should decide.
  • Only the Dimensional suite reaches the time-route change, through documents that send the timestamp as a string.

Changelog: changelog/unreleased/SOLR-13696-dimensional-routed-alias.yml (type fixed), one entry covering both production fixes.

AI assistance

AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.

….addDocsAndCommit and re-enable the test

Hypothetical, unrun regression test; see SOLR-13696-TESTING.md.
…defines

Category tests used ship_name_en, which the server _default configset never defines, so
autoCreateFields=false rejects every document. Use the string dynamic field ship_name_s.

The explicit commit now fails with a clear message if the alias is not listed, instead of a
null dereference.
@nick-boss-tech
nick-boss-tech marked this pull request as ready for review October 9, 2026 23:26
@nick-boss-tech nick-boss-tech changed the title SOLR-13696: DimensionalRoutedAliasUpdateProcessorTest / RoutedAliasUpdateProcessorTest failures due commitWithin/openSearcher delays SOLR-13696: Category and Dimensional routed-alias test suites run again, with a create-alias fix and a time-route fix Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant