Add user-defined cluster metadata#33325
Conversation
Adds a place for users to store cluster-wide data they wish to associate with the cluster via the Cluster Settings API. This is strictly for user-defined data, Elasticsearch makes no other other use of these settings.
|
Pinging @elastic/es-core-infra |
s1monw
left a comment
There was a problem hiding this comment.
Left 2 comments. LGTM otherwise
| if (randomBoolean()) { | ||
| client().admin().cluster().prepareUpdateSettings().setPersistentSettings(settings).execute().actionGet(); | ||
| ClusterStateResponse state = client().admin().cluster().prepareState().execute().actionGet(); | ||
| assertEquals(value, state.getState().getMetaData().persistentSettings().get(key)); |
There was a problem hiding this comment.
can you also add a tests that updates a setting
| String value = randomRealisticUnicodeOfCodepointLengthBetween(5, 50); | ||
|
|
||
| // Make sure we have both key and value in case this fails | ||
| logger.info("Attempting to store [{}]: [{}]", key, value); |
There was a problem hiding this comment.
this logging statement is unnecessary IMO.
| any key prefixed with `cluster.metadata.`. For example, to store the email | ||
| address of the administrator of a cluster under the key `cluster.metadata.administrator`, | ||
| issue this request: | ||
|
|
There was a problem hiding this comment.
Could be worth mentioning that settings can be both persistent and transient
There was a problem hiding this comment.
I think most (all?) settings can be set either/both persistent or transient - at least, that's how I read the Cluster Settings API docs, so I don't think it's critical to mention that here.
jasontedor
left a comment
There was a problem hiding this comment.
This LGTM to me as a v1. We might have to consider adding dedicated APIs for viewing these, or surfacing them in existing APIs (for example, /), but let's get this in and see what comes.
Adds a place for users to store cluster-wide data they wish to associate with the cluster via the Cluster Settings API. This is strictly for user-defined data, Elasticsearch makes no other other use of these settings.
Adds a place for users to store cluster-wide data they wish to associate
with the cluster via the Cluster Settings API. This is strictly for
user-defined data, Elasticsearch makes no other other use of these
settings.
Closes #33220