-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Move credentials settings merging out of RemoteClusterService
#135491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JeremyDahlgren
merged 5 commits into
elastic:main
from
JeremyDahlgren:es-12864-rm-settings-from-rcs-method
Oct 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ac0c523
Move credentials settings merging out of RemoteClusterService
JeremyDahlgren 2bbe869
Move credentials update code into TransportReloadRemoteClusterCredent…
JeremyDahlgren 0e81a47
Merge branch 'main' into es-12864-rm-settings-from-rcs-method
JeremyDahlgren 129ad47
Use clusterService.getSettings() in updateClusterCredentials()
JeremyDahlgren c3dc570
Merge branch 'main' into es-12864-rm-settings-from-rcs-method
JeremyDahlgren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fond of the way this PR turned out. I think I would prefer moving the code in
updateRemoteClusterCredentials()
intoTransportReloadRemoteClusterCredentialsAction
, and haveTransportReloadRemoteClusterCredentialsAction
callRemoteClusterService. maybeRebuildConnectionOnCredentialsChange()
with aLinkedProjectConfig
as needed. We could add a getter onRemoteClusterService
for theRemoteClusterCredentialsManager
.Yang's comment discusses using
ClusterSettingsLinkedProjectConfigService
, but we aren't aware of or have access to one, or aLinkedProjectConfigService
here. I may be misunderstanding what he is suggesting to do here.@n1v0lg @ywangd - thoughts?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't wrapped my head around this and what the cleanest approach here would be but in case this is useful:
We can easily expose
LinkedProjectConfigService
toTransportReloadRemoteClusterCredentialsAction
by injecting it during node construction:exposes it to all TransportActions:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JeremyDahlgren
My previous comment was indeed a bit vague. It took me a while to remember what I was thinking. 🤦 Sorry for the confusion.
My main point is to remove "settings usage for remote cluster config" as much as possible from
RemoteClusterService
since we now have the unifiedLinkedProjectConfig
object. Hence I mostly like to see us removingmaybeRebuildConnectionOnCredentialsChange
fromRemoteClusterService
or at least it should not takeSettings
but insteadLinkedProjectConfig
as input.For concrete changes:
RemoteClusterCredentialsManager#updateClusterCredentials
within the transport action. Conceptually this makes sense since with the unified config object,RemoteClusterService
should remove itself from dealing with these lower level updates and in long term,RemoteClusterCredentialsManager
might need to be managed independently and injected to places. One thing to note is that this means the process of "updating credentials and rebuilding connection" will be performed in twosynchronized
blocks instead of one. It feels OK to me sinceclusterCredentials
is updated as a volatile field and should not have any visible intermediate state.LinkedProjectConfigService
is not accessible inRemoteClusterService
. If we go with your suggestion of moving the logic to the transport action, we should be able to keep the code mostly as is exception in a different class.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Yang for the details here. I relocated the code as suggested, and also ended up moving both
updateClusterCredentials()
andmaybeRebuildConnectionOnCredentialsChange()
into the action class. To keep the same synchronization behavior I had a synchronized block on the RCS instance, but this may be different than what you were describing in item 1 of your comment. Please let me know what you think here.