Skip to content

Conversation

JeremyDahlgren
Copy link
Contributor

@JeremyDahlgren JeremyDahlgren commented Aug 29, 2025

Builds on work done in #133266. Adds a new interface LinkedProjectConfigService for registering LinkedProjectConfigListener instances to receive linked project configuration updates. This change introduces an abstract base class and a ClusterSettings based concrete class that provides the same functionality that was previously implemented in RemoteClusterAware and RemoteClusterService.

Subclasses of RemoteClusterAware have been adjusted to receive LinkedProjectConfig updates instead of Settings updates.

These changes allow for other linked project config implementations to be used in the system, freeing consumers of the updates from the details of the update mechanism used.

Resolves: ES-12730

@JeremyDahlgren JeremyDahlgren added :Distributed Coordination/Network Http and internode communication implementations >refactoring Team:Distributed Coordination Meta label for Distributed Coordination team v9.2.0 labels Aug 29, 2025
@JeremyDahlgren JeremyDahlgren force-pushed the es-12730-linked-proj-cfg-svc-cluster-settings branch from a6f085b to acaa03d Compare August 29, 2025 16:22
Adds a new interface LinkedProjectConfigService for registering
LinkedProjectConfigListener instances to receive linked project
configuration updates.  This change introduces an abstract base
class and a ClusterSettings based concrete class that provides
the same functionality that was previously implemented in
RemoteClusterAware and RemoteClusterService.

Subclasses of RemoteClusterAware have been adjusted to receive
LinkedProjectConfig updates instead of Settings updates.

These changes allow for other linked project config implementations
to be used in the system, freeing consumers of the updates from
the details of the update mechanism used.

Resolves: ES-12730
@JeremyDahlgren JeremyDahlgren force-pushed the es-12730-linked-proj-cfg-svc-cluster-settings branch from acaa03d to 616359b Compare August 29, 2025 16:44
@elastic elastic deleted a comment from github-actions bot Aug 29, 2025
@JeremyDahlgren JeremyDahlgren marked this pull request as ready for review September 3, 2025 21:33
@JeremyDahlgren JeremyDahlgren requested a review from a team as a code owner September 3, 2025 21:33
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
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.

Looking great. I have mostly minor comments.

Comment on lines 278 to 282
new ClusterSettingsLinkedProjectConfigService(
settings,
clusterSettings != null ? clusterSettings : ClusterSettings.createBuiltInClusterSettings(),
DefaultProjectResolver.INSTANCE
),
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this is where we can use the LinkedProjectConfigService.NOOP when clusterSettings == null? I feel its behaviour is more aligned with the existing code, i.e. no settings consumer registrion and no update for remoteCluserService.

Copy link
Contributor Author

@JeremyDahlgren JeremyDahlgren Sep 6, 2025

Choose a reason for hiding this comment

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

Many tests going through this constructor path depend on non-noop behavior. But they do not depend on the ClusterSettings update mechanism in all cases. I needed to refactor ClusterSettingsLinkedProjectConfigService so that it could still be used and support getInitialLinkedProjectConfigs() which is backed by the initial node level Settings, without registering ClusterSettings update consumers if the ClusterSettings are null.

Also I moved linkedProjectConfigService.register(remoteClusterService) call in TransportService outside of the if (clusterSettings != null) block. LinkedProjectConfigService should not be coupled with ClusterSettings.

Copy link
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

Great work! Left two comments that I'd appreciate if you could address them. Thanks!

@JeremyDahlgren JeremyDahlgren merged commit 5ea0f5d into elastic:main Sep 9, 2025
34 checks passed
Kubik42 pushed a commit to Kubik42/elasticsearch that referenced this pull request Sep 9, 2025
…lastic#133834)

Adds a new interface LinkedProjectConfigService for registering
LinkedProjectConfigListener instances to receive linked project
configuration updates.  This change introduces an abstract base
class and a ClusterSettings based concrete class that provides
the same functionality that was previously implemented in
RemoteClusterAware and RemoteClusterService.

Subclasses of RemoteClusterAware have been adjusted to receive
LinkedProjectConfig updates instead of Settings updates.

These changes allow for other linked project config implementations
to be used in the system, freeing consumers of the updates from
the details of the update mechanism used.

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

Labels

:Distributed Coordination/Network Http and internode communication implementations >refactoring Team:Distributed Coordination Meta label for Distributed Coordination team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants