Skip to content

Add support for project routing in reindex requests#142240

Merged
alexey-ivanov-es merged 10 commits intoelastic:mainfrom
alexey-ivanov-es:ES-14026
Feb 27, 2026
Merged

Add support for project routing in reindex requests#142240
alexey-ivanov-es merged 10 commits intoelastic:mainfrom
alexey-ivanov-es:ES-14026

Conversation

@alexey-ivanov-es
Copy link
Copy Markdown
Contributor

This change enables specifying project_routing in reindex requests. If cross-project search is disabled, having project_routing specified will fail validation of the request.

This change adds support for flat-world index resolution to source.index field of reindex request if cross-project search is enabled
This change enables specifying `project_routing` in reindex requests. If cross-project search is disabled, having project_routing specified will fail validation of the request.
@elasticsearchmachine elasticsearchmachine added serverless-linked Added by automation, don't add manually v9.4.0 labels Feb 10, 2026
@alexey-ivanov-es alexey-ivanov-es marked this pull request as ready for review February 25, 2026 00:36
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Feb 25, 2026
@alexey-ivanov-es alexey-ivanov-es added :Distributed/Reindex Issues relating to reindex that are not caused by issues further down and removed needs:triage Requires assignment of a team area label labels Feb 25, 2026
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team. label Feb 25, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@alexey-ivanov-es alexey-ivanov-es added >non-issue and removed Team:Distributed Meta label for distributed team. labels Feb 25, 2026
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team. label Feb 25, 2026
IndicesOptions indicesOptions = request.getSearchRequest().indicesOptions();
if (indicesOptions.resolveCrossProjectIndexExpression()) {
try {
request.getSearchRequest()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was moved to ReindexValidator.skipRemoteIndexNames

Copy link
Copy Markdown
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I have some minor comments and I'd appreciate if you could address them. Thanks!

Comment on lines +173 to +175
if (searchRequest.getProjectRouting() != null) {
entity.field("project_routing", searchRequest.getProjectRouting());
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a test for this to ensure project_routing is propagate to the request targeting a HTTP remote?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a unit-test, more tests will be a follow-up PR

@alexey-ivanov-es alexey-ivanov-es merged commit c68c5f8 into elastic:main Feb 27, 2026
35 checks passed
@alexey-ivanov-es alexey-ivanov-es deleted the ES-14026 branch February 27, 2026 13:58
szybia added a commit to szybia/elasticsearch that referenced this pull request Feb 27, 2026
…cations

* upstream/main:
  Warn on API key version mismatch (elastic#143127)
  Fixed wrong malformed value ordering in synthetic source tests (elastic#143187)
  [ML] Fix: required_native_memory_bytes Calculated with Wrong Allocation Count (elastic#143077)
  Add configureBenchmarkLogging calls across the various benchmarks (elastic#143185)
  Mute org.elasticsearch.xpack.esql.CsvIT test {csv-spec:k8s-timeseries-avg-over-time.Avg_over_time_aggregate_metric_double_implicit_casting} elastic#143292
  Give system role permission to invoke shard refresh (elastic#143190)
  Mute testSyntheticSourceWithTranslogSnapshot (elastic#143260)
  Adds ResumeInfo Tests (elastic#142769)
  Use a static method to configure benchmark logging (elastic#143056)
  add connectors release notes (elastic#142884)
  Add CI triage guidance for AI agents (elastic#142994)
  ESQL: Data sources: ZSTD, BZIP2 (elastic#143228)
  [ES|QL] Channels issue when an agg is called with the same field (elastic#142180) (elastic#142269)
  Add support for project routing in reindex requests (elastic#142240)
tballison pushed a commit to tballison/elasticsearch that referenced this pull request Mar 3, 2026
This change adds support for flat-world index resolution to source.index field of reindex request if cross-project search is enabled
alexey-ivanov-es added a commit to elastic/elasticsearch-specification that referenced this pull request Mar 10, 2026
project_routing parameter was added to reindex requests in elastic/elasticsearch#142240, this change updates the spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Reindex Issues relating to reindex that are not caused by issues further down >non-issue serverless-linked Added by automation, don't add manually Team:Distributed Meta label for distributed team. v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants