Skip to content

Commit

Permalink
Move Watcher versioning setting to meta field (#30832)
Browse files Browse the repository at this point in the history
The .watcher-history-* template is currently using a plugin-custom index setting xpack.watcher.template.version,
which prevents this template from being installed in a mixed OSS / X-Pack cluster, ultimately
leading to the situation where an X-Pack node is constantly spamming an OSS master with (failed)
template updates. Other X-Pack templates (e.g. security-index-template or security_audit_log)
achieve the same versioning functionality by using a custom _meta field in the mapping instead.
This commit switches the .watcher-history-* template to use the _meta field instead.
  • Loading branch information
ywelsch committed May 24, 2018
1 parent 6ed1c70 commit 83edd5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x-pack/plugin/core/src/main/resources/watch-history.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
"index_patterns": [ ".watcher-history-${xpack.watcher.template.version}*" ],
"order": 2147483647,
"settings": {
"xpack.watcher.template.version": "${xpack.watcher.template.version}",
"index.number_of_shards": 1,
"index.number_of_replicas": 0,
"index.auto_expand_replicas": "0-1",
"index.format": 6
},
"mappings": {
"doc": {
"_meta": {
"watcher-history-version": "${xpack.watcher.template.version}"
},
"dynamic_templates": [
{
"disabled_payload_fields": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@

public class Watcher extends Plugin implements ActionPlugin, ScriptPlugin {

// This setting is only here for backward compatibility reasons as 6.x indices made use of it. It can be removed in 8.x.
@Deprecated
public static final Setting<String> INDEX_WATCHER_TEMPLATE_VERSION_SETTING =
new Setting<>("index.xpack.watcher.template.version", "", Function.identity(), Setting.Property.IndexScope);
public static final Setting<Boolean> ENCRYPT_SENSITIVE_DATA_SETTING =
Expand Down

0 comments on commit 83edd5d

Please sign in to comment.