Add infrastructure to transactionally apply and reset dynamic settings#15278
Add infrastructure to transactionally apply and reset dynamic settings#15278s1monw merged 40 commits intoelastic:masterfrom
Conversation
This commit adds the infrastructure to make settings that are updateable resetable and changes the application of updates to be transactional. This means setting updates are either applied or not. If the application failes all values are rejected. This initial commit converts all dynamic cluster settings to make use of the new infrastructure. All cluster level dynamic settings are not resettable to their defaults or to the node level settings. The infrastructure also allows to list default values and descriptions which is not fully implemented yet. Values can be reset using a list of key or simple regular expressions. This has only been implemented on the java layer yet. For instance to reset all recovery settings to their defaults a user can just specify `indices.recovery.*`. This commit also adds strict settings validation, if a setting is unknown or if a setting can not be applied the entire settings update request will fail.
720fcb6 to
5d7f4ef
Compare
|
Briefly looked at it last night but I'll actually review it now. |
There was a problem hiding this comment.
Since I haven't looked at setting the cluster readonly before I kind of assumed this would be handled in a listener in some ClusterStateService-style object rather than in settings. Maybe a comment why its here?
There was a problem hiding this comment.
I see. This was extracted from ClusterSettingsService. It makes sense now. Cool.
|
@bleskes pushed a new commit and merge with master |
There was a problem hiding this comment.
imo the min value for these should be 1 - there are enough ways to block recovery that are more straight forward
There was a problem hiding this comment.
I'd like to keep this as is for now - I think this needs a sep issue
There was a problem hiding this comment.
sure. as long as we don't forget :)
|
LGTM except for the array setting support. I'm fine with doing this as a followup as it seems we only have one dynamic cluster level setting that relies on that and that one can live just fine with the comma based. Note though that the array notation is used in more places which are non-dynamic (discovery.zen.ping.unicast.hosts, for example). I think we should do those as well (as a followup)? |
|
@bleskes I added yet another special case for setting which pisses me off but I have no choice. this has been fucked up in the past and is hard to fix for the future. Anyway I think it's ready and I will push very soon |
|
@s1monw thanks for the extra effort. Sadly, I don't think this is enough as we still don't deal correctly with how we parse json arrays into key.0 , key.1 etc. The request I gave above still fails and we move none dynamic settings into this infra we will have similar options. As I said before - I think we should push this in as iterate on this. We do need to support |
|
@bleskes ok I added several tests that this works :) |
|
@s1monw thanks. I dug deeper as it still didn't work. Here's the problem, I think: It seems we need one more test? |
|
more tests tests and tests I push this now it's not going to be better. |
Add infrastructure to transactionally apply and reset dynamic settings
|
\o/\o/\o/ THX ! |
This commit adds the infrastructure to make settings that are updateable
resetable and changes the application of updates to be transactional. This means
setting updates are either applied or not. If the application failes all values are rejected.
This initial commit converts all dynamic cluster settings to make use of the new infrastructure.
All cluster level dynamic settings are not resettable to their defaults or to the node level settings.
The infrastructure also allows to list default values and descriptions which is not fully implemented yet.
Values can be reset using a list of key or simple regular expressions. This has only been implemented on the java
layer yet. For instance to reset all recovery settings to their defaults a user can just specify
indices.recovery.*.This commit also adds strict settings validation, if a setting is unknown or if a setting can not be applied the entire
settings update request will fail.