Skip to content

Conversation

@piergm
Copy link
Member

@piergm piergm commented Nov 12, 2025

Enables _pit endpoint to be cross project. (allowsCrossProject return true)
Disable cross project chaining (by calling indicesOptionsForCrossProjectFanout that sets CrossProjectModeOptions back to default)
Adds project routing parameter in _pit if crossProjectEnabled (query param only)
Disallows projectRouting for _search if in CPS context and pit id is provided.

Missing: Allow UIAM for close pit endpoint.

@piergm piergm changed the title wip - do not merge allows PIT to be cross project Nov 18, 2025
@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Nov 18, 2025
@piergm piergm self-assigned this Nov 18, 2025
@piergm piergm added >enhancement :Search Foundations/Search Catch all for Search Foundations labels Nov 18, 2025
@piergm piergm marked this pull request as ready for review November 18, 2025 16:43
@piergm piergm requested review from pawankartik-elastic and quux00 and removed request for quux00 November 18, 2025 16:43
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Nov 18, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine
Copy link
Collaborator

Hi @piergm, I've created a changelog YAML for you.

Copy link
Contributor

@pawankartik-elastic pawankartik-elastic left a comment

Choose a reason for hiding this comment

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

Initial comments.

Copy link
Contributor

@quux00 quux00 left a comment

Choose a reason for hiding this comment

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

First pass review complete with suggestions and questions.

@quux00
Copy link
Contributor

quux00 commented Nov 20, 2025

For the description comment:

Missing: Allow UIAM for close pit endpoint.

Do we intend to tackle that in this PR or will be a follow-on? (Asking partly because we may not want Wei to do QA tests on this until close PIT is done?)

Copy link
Contributor

@luigidellaquila luigidellaquila left a comment

Choose a reason for hiding this comment

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

Thanks @piergm, I had a first look and I tested it with EQL, see my comment below

@piergm
Copy link
Member Author

piergm commented Nov 21, 2025

@quux00

Do we intend to tackle that in this PR or will be a follow-on? (Asking partly because we may not want Wei to do QA tests on this until close PIT is done?)

Really depends on when the non-Replaceable endpoints will allow UIAM. If it's early next week we can wait, otherwise I'd merge this and do a follow-up for PIT close.

With that said when we merge this PR we can add to the E2E tests PIT open and search with PIT IMO.

Copy link
Contributor

@quux00 quux00 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 left a few questions and nits only.

this.client = client;
this.crossProjectModeDecider = new CrossProjectModeDecider(clusterService.getSettings());
this.forceConnectTimeoutSecs = clusterService.getSettings()
.getAsTime("search.ccs.force_connect_timeout", TimeValue.timeValueSeconds(3L));
Copy link
Contributor

Choose a reason for hiding this comment

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

(asking to learn) - When is this set vs. taking the default of 3 seconds? I think for CPS we want to always ensure it is 3 seconds, so is search.ccs.force_connect_timeout always defined (and set to 3 seconds) for CPS or should we be using the CrossProjectModeDecider here to determine what timeout setting to use?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's only being used by CPS because we only call it in executeOpenPitCrossProject, so I don't think we need to have another if statement for CrossProjectModeDecider.
On when/if is set I think we (ES eng) are the only one that can override/set this setting through gitops repo

Copy link
Contributor

@pawankartik-elastic pawankartik-elastic Nov 27, 2025

Choose a reason for hiding this comment

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

When is this set

When we manually "inject" the corresponding value from our end for Serverless CPS. I had a brief chat with Matteo about this, and there's scope for improvement/refactoring here: we'll abstract this away and move it elsewhere so that we won't have to:

  1. Hardcode the setting in n number of places across the codebase,
  2. Repeatedly check for the existence of this setting, and,
  3. Repeatedly declare the fallback values.

Currently, it's being used in Search, Field Caps, and PIT (this).

Copy link
Contributor

@quux00 quux00 left a comment

Choose a reason for hiding this comment

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

Approved, but I'd like to have Pawan's approval before merging.

Copy link
Contributor

@pawankartik-elastic pawankartik-elastic left a comment

Choose a reason for hiding this comment

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

LGTM. Any outstanding comments are minor nitpicks and not blockers. Approving.

@piergm piergm merged commit bee48f8 into elastic:main Nov 27, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Foundations/Search Catch all for Search Foundations serverless-linked Added by automation, don't add manually Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants