Skip to content

Commit 9c20e52

Browse files
pmuellrsarog
authored andcommitted
Adding _meta.template_version to kibana reporting mappings (elastic#133846) (elastic#134015)
Part of elastic/kibana#231200 . We realized that when the mappings are updated in a version upgrade, the mappings are in fact updated, but not applied to the current reporting datastream. To fix this, we'll make a determination in Kibana that we should roll over the data stream if the version in the template does not match the version in the mappings of the datastream. If they match, we don't need to do anything. If they don't match, or the version of the mappings is not in the datastream (from before this PR), we will need to roll over the data stream to apply the new mappings. To make this happen, we need to add a new field to the mapping `_meta`, which should match the template version. references: - https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/mapping-meta-field Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit ebb94bd) # Conflicts: # x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java
1 parent d0635f3 commit 9c20e52

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

x-pack/plugin/core/template-resources/src/main/resources/[email protected]

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"template": {
1111
"lifecycle": {},
1212
"mappings": {
13+
"_meta": {
14+
"template_version": ${xpack.stack.template.version}
15+
},
1316
"properties": {
1417
"meta": {
1518
"properties": {

x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class StackTemplateRegistry extends IndexTemplateRegistry {
4747

4848
// The stack template registry version. This number must be incremented when we make changes
4949
// to built-in templates.
50-
public static final int REGISTRY_VERSION = 16;
50+
public static final int REGISTRY_VERSION = 18;
5151

5252
public static final String TEMPLATE_VERSION_VARIABLE = "xpack.stack.template.version";
5353
public static final Setting<Boolean> STACK_TEMPLATES_ENABLED = Setting.boolSetting(

0 commit comments

Comments
 (0)