Skip to content

Remove leniency in LinkedProjectConfig builder methods#139012

Merged
JeremyDahlgren merged 11 commits intoelastic:mainfrom
JeremyDahlgren:es-12737-linked-proj-cfg-bldr-leniency
Dec 11, 2025
Merged

Remove leniency in LinkedProjectConfig builder methods#139012
JeremyDahlgren merged 11 commits intoelastic:mainfrom
JeremyDahlgren:es-12737-linked-proj-cfg-bldr-leniency

Conversation

@JeremyDahlgren
Copy link
Copy Markdown
Contributor

@JeremyDahlgren JeremyDahlgren commented Dec 3, 2025

Addresses the TODOs in the builders to eliminate support for nulls or empty strings/collections in the builder property setter methods. See this comment from #133266 for details on the origin of the TODOs.

This has two significant API changes:

  • The addition of LinkedProjectConfigListener.remove()
  • The removal of LinkedProjectConfig.isConnectionEnabled()

It is impossible to construct a disabled LinkedProjectConfig instance since there are explicit checks now in the builders.
All implementations of LinkedProjectConfigListener needed to be updated for the two API changes above.

Resolves: ES-12737

Addresses the TODOs in the builders to eliminate support
for nulls or empty strings/collections in the builder
property setter methods.

Resolves: ES-12737
@JeremyDahlgren JeremyDahlgren added >non-issue :Distributed/Network Http and internode communication implementations Team:Distributed Coordination (obsolete) Meta label for Distributed Coordination team. Obsolete. Please do not use. v9.3.0 labels Dec 3, 2025
@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Dec 3, 2025
@JeremyDahlgren JeremyDahlgren requested a review from ywangd December 3, 2025 21:31
@JeremyDahlgren JeremyDahlgren marked this pull request as ready for review December 3, 2025 21:31
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@JeremyDahlgren JeremyDahlgren requested review from ywangd and removed request for ywangd December 8, 2025 22:09
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.

Some minor comments

Comment on lines +119 to +121
if (RemoteClusterSettings.isConnectionEnabled(clusterAlias, mergedSettings)) {
maybeRebuildConnectionOnCredentialsChange(toConfig(projectId, clusterAlias, mergedSettings), connectionRefs);
}
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.

Two comments:

  1. Can we have the RemoteClusterSettings.isConnectionEnabled check inside maybeRebuildConnectionOnCredentialsChange?
  2. Do we need to handle isConnectionEnabled() == false scenario?

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.

I moved the RemoteClusterSettings.isConnectionEnabled() check as suggested, and included it with the other check in the if at the beginning of maybeRebuildConnectionOnCredentialsChange(). The log message is generic enough to cover both scenarios, but I could break them into separate ifs with tailored log messages if you think it would add value?

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.

Hmm did you push the change? The file TransportReloadRemoteClusterCredentialsAction.java‎ looks the same to me?

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.

Apologies, I had an issue with my submodule branch. The change should be in cc68a15.

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.

The log message is fine. I was thinking whether we need to actively call remoteClusterService.remove(...) when isConnectionEnabled() == false. It seems to be a more consistent behaviour with the existing code. That said, the cluster settings updater should tear down the connection if it is not done here. So likely does not matter in practice. I'll leave it up to you to decide.

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.

I refactored to call remove() if we detect the connection is disabled, 397515c.

@JeremyDahlgren JeremyDahlgren requested a review from ywangd December 9, 2025 22:11
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

One optional suggestion for actively invoking remoteClusterService.remove(...) for your consideration.

@JeremyDahlgren JeremyDahlgren merged commit 4f9d7b1 into elastic:main Dec 11, 2025
34 checks passed
szybia added a commit to szybia/elasticsearch that referenced this pull request Dec 11, 2025
* upstream/main: (79 commits)
  Mute org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT test {p0=search/140_pre_filter_search_shards/prefilter on non-indexed date fields} elastic#139381
  Adjust error bounds for bfloat16 value checks (elastic#139371)
  Unmute some vector CSS tests (elastic#139370)
  Do not allow `project_routing` as a query param (elastic#139206)
  Unmute HalfFloat...Tests#testSynthesizeArrayRandom (elastic#139341)
  Remove leniency in LinkedProjectConfig builder methods (elastic#139012)
  EQL: fix project_routing (elastic#139366)
  Add patch version for 9.2 index version constant (elastic#139362)
  Mute org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT test {p0=search.vectors/200_dense_vector_docvalue_fields/dense_vector docvalues with bfloat16} elastic#139368
  ES|QL: Enable CCS tests for FORK (elastic#139302)
  Restructuring the semantic_text field type page  (elastic#138571)
  AggregateMetricDouble fields should not build BKD indexes (elastic#138724)
  Feature/count by trunc with filter (elastic#138765)
  ESQL: Convert TS 500 error to 400 (elastic#139360)
  [CI] Rerun failing tests for periodic build pipelines (elastic#139200)
  revert muting saml test (elastic#139327)
  Add TDigest histogram as metric (elastic#139247)
  Links solved bugs to class cast exception changelog and unmutes errors (elastic#139340)
  Ensure integer sorts are rewritten to long sorts for BWC indexes (elastic#139293)
  Integrate stored fields format bloom filter with synthetic _id (elastic#138515)
  ...
JeremyDahlgren added a commit to JeremyDahlgren/elasticsearch that referenced this pull request Dec 12, 2025
Adds a new unit test class for TransportReloadRemoteClusterCredentialsAction.
This is a follow up from elastic#135491, where a significant chunk of code was
moved from RemoteClusterService into TransportReloadRemoteClusterCredentialsAction.
This also verifies code touched recently in elastic#139012.

Resolves: ES-13161
JeremyDahlgren added a commit that referenced this pull request Dec 13, 2025
…39414)

Adds a new unit test class for TransportReloadRemoteClusterCredentialsAction.
This is a follow up from #135491, where a significant chunk of code was
moved from RemoteClusterService into TransportReloadRemoteClusterCredentialsAction.
This also verifies code touched recently in #139012.

Resolves: ES-13161
parkertimmins pushed a commit to parkertimmins/elasticsearch that referenced this pull request Dec 17, 2025
…astic#139414)

Adds a new unit test class for TransportReloadRemoteClusterCredentialsAction.
This is a follow up from elastic#135491, where a significant chunk of code was
moved from RemoteClusterService into TransportReloadRemoteClusterCredentialsAction.
This also verifies code touched recently in elastic#139012.

Resolves: ES-13161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Network Http and internode communication implementations >non-issue serverless-linked Added by automation, don't add manually Team:Distributed Coordination (obsolete) Meta label for Distributed Coordination team. Obsolete. Please do not use. v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants