Skip to content

Commit ebb94bd

Browse files
Adding _meta.template_version to kibana reporting mappings (#133846)
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]>
1 parent de98e5d commit ebb94bd

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
@@ -37,7 +37,7 @@ public class StackTemplateRegistry extends IndexTemplateRegistry {
3737

3838
// The stack template registry version. This number must be incremented when we make changes
3939
// to built-in templates.
40-
public static final int REGISTRY_VERSION = 17;
40+
public static final int REGISTRY_VERSION = 18;
4141

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

0 commit comments

Comments
 (0)