Skip to content

Conversation

JeremyDahlgren
Copy link
Contributor

Moves the REMOTE_CLUSTER_SKIP_UNAVAILABLE setting into the main AffixSettings list in ClusterSettingsLinkedProjectConfigService, eliminating the need for an extra skip_unavailable specific update method on the LinkedProjectConfigListener interface, simplifying the design. Note that it is not possible to just set REMOTE_CLUSTER_SKIP_UNAVAILABLE in a settings update, the RemoteClusterSettings.RemoteConnectionEnabled settings validator checks that the required settings for an enabled connection are also present.

Resolves: ES-12860

Moves the REMOTE_CLUSTER_SKIP_UNAVAILABLE setting into the main
AffixSettings list in ClusterSettingsLinkedProjectConfigService,
eliminating the need for an extra skip_unavailable specific
update method on the LinkedProjectConfigListener interface,
simplifying the design.  Note that it is not possible to just set
REMOTE_CLUSTER_SKIP_UNAVAILABLE in a settings update, the
RemoteConnectionEnabled settings validator checks that the required
settings for an enabled connection are also present.

Resolves: ES-12860
@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 Sep 30, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@JeremyDahlgren JeremyDahlgren requested a review from ywangd October 1, 2025 14:15
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.

Thanks for working on this. I have some questions.

remote.ensureConnected(listener.map(ignored -> RemoteClusterConnectionStatus.RECONNECTED));
} else {
if (crossProjectEnabled == false) {
remote.setSkipUnavailable(config.skipUnavailable());
Copy link
Member

Choose a reason for hiding this comment

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

To be strictly faithful to existing behaviour, I think this should be something like

Suggested change
remote.setSkipUnavailable(config.skipUnavailable());
if (remote.isSkipUnavailable() != config.skipUnavailable()) {
remote.setSkipUnavailable(config.skipUnavailable());
}

Comment on lines 443 to 444
// No changes to connection configuration.
listener.onResponse(RemoteClusterConnectionStatus.UNCHANGED);
Copy link
Member

Choose a reason for hiding this comment

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

It is a little odd that we report UNCHANGED when skipUnavailable changes. It might be useful to add a new enum such as UPDATED for updating properties on existing connection.

connectionMap.put(clusterAlias, remote);
remote.ensureConnected(listener.map(ignored -> RemoteClusterConnectionStatus.RECONNECTED));
} else {
if (crossProjectEnabled == false) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this a new change? The existing code does not seem to check this when updating it? I remember we discussed previously that skipUnavailable should not be used in CPS. But I forgot exactly what implementation we settled with. It feels that we should block setting it in the first place instead of silently ignore it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, this would be a new check, I removed this. In #132478 we are adding the setting validator that would reject the setting being configured.

@JeremyDahlgren JeremyDahlgren requested a review from ywangd October 8, 2025 21:02
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

var skipUnavailable = randomBoolean();
applySettingsAndVerify.accept(skipUnavailable, remote1Transport);

// Change skip_unavailable value, but not seed node, connection should not be rebuilt, but skip_unavailable should be modified.
Copy link
Member

Choose a reason for hiding this comment

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

It would be great to somehow assert that the connection is the same instance, i.e. no rebuilding.

@JeremyDahlgren JeremyDahlgren merged commit 83ef0cf into elastic:main Oct 9, 2025
34 checks passed
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.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants