Skip to content

feat: add multi-target routing and per-target catch-up lifecycle#2818

Draft
bhabegger wants to merge 6 commits intoapache:OAK-12089from
bhabegger:oak-12089-multitarget
Draft

feat: add multi-target routing and per-target catch-up lifecycle#2818
bhabegger wants to merge 6 commits intoapache:OAK-12089from
bhabegger:oak-12089-multitarget

Conversation

@bhabegger
Copy link
Copy Markdown
Contributor

Summary

  • add multi-target routing helpers (storeTargets/activeTarget) and integrate write/query target selection
  • add per-target catch-up lifecycle (detection, runner, graduation) for safe target backfill before activation
  • refine catch-up with lane-scoped graduation and marker-based provider participation contract

Test plan

  • mvn -pl oak-core -Dtest=\"IndexDefinitionHelperTest,AsyncIndexUpdateCatchUpTest,CatchUpRunnerTest\" test
  • additional integration and full reactor verification in CI

Notes

This branch is functionally split from lucene9 core work, but because GitHub cross-repo PRs require a base branch present in the target repository, this PR currently targets OAK-12089 directly.
Depends on #2817 and should be reviewed/merged after it.

Made with Cursor

@bhabegger
Copy link
Copy Markdown
Contributor Author

This PR depends on #2817 and should be reviewed/merged only after #2817 is merged.

Introduces oak-search-luceneNg, a new Oak module providing a Lucene 9
based index engine under type=lucene9, with full parity to the legacy
lucene implementation for property queries, fulltext, sorting, excerpts,
and facets (insecure, statistical, and secure ACL modes).

Key changes:
- New oak-search-luceneNg module: index editor, query index, tracker,
  index node, storage, and OSGi wiring
- Facet parity: LuceneNgSecure/StatisticalSortedSetDocValuesFacetCounts
  ported to Lucene 9 APIs with null-safe MatchingDocs.bits handling
- LuceneNgFacetCommonTest extends FacetCommonTest for JCR-level coverage
- AbstractIndexComparisonTest inlined into oak-search test-jar;
  oak-search-test module removed
- getRootBuilder removed from ContextAwareCallback and IndexUpdate
- leaf OSGi property removed from LuceneIndexProviderService
- README documents feature parity vs legacy Lucene and Elastic

Made-with: Cursor
When indexNodeName=true, the index editor writes the namespace-stripped
local name of each node into FieldNames.NODE_NAME. The query engine maps
LOCALNAME() equality and LIKE restrictions to TermQuery/WildcardQuery on
that field.

Function restrictions prefixed with "function*@" (e.g. "function*@:localname")
are generated alongside the dedicated ":localname" restriction by Oak's SQL2
parser; they are now silently dropped from plan evaluation, cost calculation,
and the Lucene query to prevent false negatives.

Adds NodeNameCommonTest (shared) and LuceneNgNodeNameCommonTest.

Made-with: Cursor
…ADME

Address PR review comments from thomasmueller:
- Rename "Multi-index queries" to "Composite node store queries" and add a
  footnote explaining the composite node store scenario.
- Add a footnote for "Index augmentors" describing the IndexFieldProvider /
  FulltextQueryTermsProvider extension points.

Made-with: Cursor
@bhabegger bhabegger force-pushed the oak-12089-multitarget branch from f891100 to 1633d58 Compare March 30, 2026 12:19
Follows Maven/Oak convention of lowercase hyphenated artifact names.
The Java package (org.apache.jackrabbit.oak.plugins.index.luceneNg) is
unchanged as it is an internal implementation detail.

Made-with: Cursor
@bhabegger bhabegger force-pushed the oak-12089-multitarget branch from 1633d58 to d9c9208 Compare March 30, 2026 14:58
…etCommonTest

The three tests (basic faceting, multiple dimensions, facet with filter)
are all already exercised by FacetCommonTest via the JCR API.
LuceneNgFacetCommonTest runs that suite against Lucene 9 and is the
canonical coverage. The ignored class added no value.

Made-with: Cursor
- Add multi-target routing helpers and active-target resolution
- Add per-target catch-up indexing lifecycle
- Simplify catch-up execution and scope graduation to owning lane
- Align with marker-based catch-up provider contract

Made-with: Cursor
@bhabegger bhabegger force-pushed the oak-12089-multitarget branch from d9c9208 to 6eaf573 Compare March 31, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant