-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Rebuild remote connections on profile changes #37678
Rebuild remote connections on profile changes #37678
Conversation
Pinging @elastic/es-distributed |
This is a POC for the change. I had to add a method to handle listening for more than two related settings. So please take a look at that as it is an area of the code I have not worked with much. Additionally I need to add a test for setting changes in the |
* Note: Only settings registered in {@link SettingsModule} can be changed dynamically. | ||
* </p> | ||
*/ | ||
public synchronized void addAffixGroupUpdateConsumer(List<Setting.AffixSetting<?>> settings, BiConsumer<String, Settings> consumer) { |
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.
Can you pull this out into a separate change, leaving the usage here for reference? Then we can integrate this back after that has a separate review from the core/infra team.
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 opened #37679
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.
left a question
getNodePredicate(settings), proxyAddress); | ||
remoteClusters.put(clusterAlias, remote); | ||
} else if (connectionProfileChanged(remote.getConnectionManager().getConnectionProfile(), connectionProfile)) { | ||
// New ConnectionProfile. Must tear down existing connection |
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.
if I understand this correctly we will cause existing connections to fail and further, if concurrently somebody is using is it will not be able to retry since it's close and there will be intermediate failures in such a case. I think in this case we have to somehow reconfigure instead of closing? I know I would like this to be simple but the sideeffects of a close of a connection while some consumer is "in the middle of something" might cause a lot of headaches since it's a rare event, hard to debug and to test. WDYT?
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.
What you're describing is possible but will require changes at multiple levels of the networking stack. The ConnectionProfile
is not currently mutable. So compression and ping intervals will need to be mutable. It also raises the question of whether connection timeout and handshake timeout would be mutable. I guess not since they are not dynamic settings currently. I think it would be very complicated to change the number of channels and their types, so that should stay static.
The compression change would be straightforward. For every request it we could just read from the volatile variable in the connection profile. Ping interval would be trickier because we would need to reschedule it to a different ping interval (probably at the completion of a ping-run).
It can be done, but it is uncertain to make the next release. It also would require reworking a lot with ConnectionProfile
. Let me know if this is your preference and I will pursue updating this PR with those changes at some point in the future.
I just want to send a ping that this is still outstanding. Maybe we should have a discussion about what behavior we want here? |
@jasontedor @ywelsch @s1monw - I know that we spoke about updating settings and accepting occasional failures earlier today. However, when working on implementing a test for this scenario (that ccr following will recover) I encountered an issue. Both
I assume this is fine? They need to re-add the seeds in order to add compression and ping schedule. |
I also updated the documentation in |
I think this is fine as long as it's documented. |
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 made a few additional edits in the documentation. LGTM and builds successfully
the point here was that this should only be set when the cluster is added. I think we should add this as a recommendation. |
Currently remote compression and ping schedule settings are dynamic. However, we do not listen for changes. This commit adds listeners for changes to those two settings. Additionally, when those settings change we now close existing connections and open new ones with the settings applied. Fixes elastic#37201.
Currently remote compression and ping schedule settings are dynamic. However, we do not listen for changes. This commit adds listeners for changes to those two settings. Additionally, when those settings change we now close existing connections and open new ones with the settings applied. Fixes elastic#37201.
Currently remote compression and ping schedule settings are dynamic. However, we do not listen for changes. This commit adds listeners for changes to those two settings. Additionally, when those settings change we now close existing connections and open new ones with the settings applied. Fixes elastic#37201.
…follow * elastic/master: (37 commits) Enable test logging for TransformIntegrationTests#testSearchTransform. stronger wording for ilm+rollover in docs (elastic#39159) Mute SingleNodeTests (elastic#39156) AwaitsFix XPackUsageIT#testXPackCcrUsage. Resolve concurrency with watcher trigger service (elastic#39092) Fix median calculation in MedianAbsoluteDeviationAggregatorTests (elastic#38979) [DOCS] Edits the remote clusters documentation (elastic#38996) add version 6.6.2 Revert "Mute failing test 20_mix_typless_typefull (elastic#38781)" (elastic#38912) Rebuild remote connections on profile changes (elastic#37678) Document 'max_size' parameter as shard size for rollover (elastic#38750) Add some missing toString() implementations (elastic#39124) Migrate Streamable to Writeable for cluster block package (elastic#37391) fix RethrottleTests retry (elastic#38978) Disable date parsing test in non english locale (elastic#39052) Remove BCryptTests (elastic#39098) [ML] Stop the ML memory tracker before closing node (elastic#39111) Allow retention lease operations under blocks (elastic#39089) ML refactor DatafeedsConfig(Update) so defaults are not populated in queries or aggs (elastic#38822) Fix retention leases sync on recovery test ...
Currently remote compression and ping schedule settings are dynamic.
However, we do not listen for changes. This commit adds listeners for
changes to those two settings. Additionally, when those settings change
we now close existing connections and open new ones with the settings
applied.
Fixes #37201.