Skip to content

component template cannot update after ES7.8 reboot #58643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shotecorps opened this issue Jun 29, 2020 · 5 comments
Closed

component template cannot update after ES7.8 reboot #58643

shotecorps opened this issue Jun 29, 2020 · 5 comments
Assignees
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team

Comments

@shotecorps
Copy link

Elasticsearch version (bin/elasticsearch --version): 7.8.0

Plugins installed: []

JVM version (java -version):
openjdk 14.0.1 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 14.0.1+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 14.0.1+7, mixed mode, sharing)

OS version (uname -a if on a Unix-like system):
Linux ubuntu 4.15.0-106-generic #107-Ubuntu SMP Thu Jun 4 11:27:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
Running 7.8.0 official docker image. Put an index template that using one component template. Restart the container.
Use the same configuration to update the existed component template. You will get "updating component template [x] results in invalid composable template [x] after templates are merged"

Steps to reproduce:
1.Start a es7.8.0 nodel with docker-compose.
compose file:
version: '3'
services:
es_master:
image: elasticsearch:7.8.0
container_name: es_master
restart: always
environment:
- cluster.name=shotecorps
- network.host=192.168.55.3
- http.port=9200
- transport.port=9300
- node.name=master
- node.remote_cluster_client=false
- node.ml=false
- discovery.seed_hosts=192.168.55.3:9300
- cluster.initial_master_nodes=master1
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- "action.auto_create_index=-write-,-act-,-read-,"
- "node.attr.hot=true"
- "node.attr.warm=true"
- path.repo=/usr/share/elasticsearch/data/backup
- bootstrap.memory_lock=true
ports:
- "9300:9300"
volumes:
- /opt/elasticsearch/config/:/usr/share/elasticsearch/config/
- /opt/elasticsearch/data/:/usr/share/elasticsearch/data/
- /opt/elasticsearch/log/:/usr/share/elasticsearch/logs/
logging:
driver: "json-file"
options:
max-size: "100m"
network_mode: "host"
kibana:
image: kibana:7.8.0
container_name: kibana
restart: always
container_name: kibana
restart: always
environment:
- ELASTICSEARCH_URL=http://192.168.55.3:9200
- ELASTICSEARCH_HOSTS=http://192.168.55.3:9200
ports:
- "5601:5601"

  1. put component template
    PUT _component_template/a
    {
    "template": {
    "settings": {
    "index": {
    "codec": "default",
    "routing": {
    "allocation": {
    "require": {
    "hot": "true"
    }
    }
    },
    "refresh_interval": "60s",
    "number_of_shards": "1",
    "number_of_replicas": "0"
    }
    },
    "mappings": {
    "dynamic": "false"
    }
    }
    }

  2. put index template
    PUT _index_template/template_2
    {
    "index_patterns": ["test*"],
    "template": {
    "mappings": {
    "properties": {
    "host_name": {
    "type": "keyword"
    }
    }
    }
    },
    "priority": 10,
    "composed_of": ["a"]
    }

(Now you can update the component/index template, or create new index template that uses the existed component template successfully)

  1. kill es container and restart it
    shotecorps@ubuntu:/tmp$ docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    1743ca1ce44b kibana:7.8.0 "/usr/local/bin/dumb…" 5 minutes ago Up 5 minutes 0.0.0.0:5601->5601/tcp kibana
    56a923fdf7c2 elasticsearch:7.8.0 "/tini -- /usr/local…" 5 minutes ago Up 5 minutes es_master
    shotecorps@ubuntu:
    /tmp$ docker rm 56a923fdf7c2 -f
    56a923fdf7c2
    shotecorps@ubuntu:/tmp$ docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    1743ca1ce44b kibana:7.8.0 "/usr/local/bin/dumb…" 5 minutes ago Up 5 minutes 0.0.0.0:5601->5601/tcp kibana
    shotecorps@ubuntu:
    /tmp$ docker-compose -f docker-compose.yml up -d
    kibana is up-to-date
    Creating es_master ... done

  2. After es started, update old component template will get error response.
    And you cannot put new index template that uses the old component template either.

PUT _component_template/a
{
"template": {
"settings": {
"index": {
"codec": "default",
"routing": {
"allocation": {
"require": {
"hot": "true"
}
}
},
"refresh_interval": "60s",
"number_of_shards": "1",
"number_of_replicas": "0"
}
},
"mappings": {
"dynamic": "false"
}
}
}

{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "updating component template [a] results in invalid composable template [template_2] after templates are merged"
}
],
"type" : "illegal_argument_exception",
"reason" : "updating component template [a] results in invalid composable template [template_2] after templates are merged",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "invalid composite mappings for [template_2]",
"caused_by" : {
"type" : "illegal_state_exception",
"reason" : "invalid mapping definition, expected a single map underneath [_doc] but it was: [{properties={host_name={type=keyword}}}]"
}
}
},
"status" : 400
}

PUT _index_template/template_3
{
"index_patterns": ["new*"],
"template": {
"mappings": {
"properties": {
"host_name": {
"type": "keyword"
}
}
}
},
"priority": 10,
"composed_of": ["a"]
}
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "composable template [template_3] template after composition with component templates [a] is invalid"
}
],
"type" : "illegal_argument_exception",
"reason" : "composable template [template_3] template after composition with component templates [a] is invalid",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "invalid composite mappings for [template_3]",
"caused_by" : {
"type" : "illegal_state_exception",
"reason" : "invalid mapping definition, expected a single map underneath [_doc] but it was: [{dynamic=false}]"
}
}
},
"status" : 400
}

@shotecorps shotecorps added >bug needs:triage Requires assignment of a team area label labels Jun 29, 2020
@tvernum tvernum added :Data Management/Indices APIs APIs to create and manage indices and templates and removed needs:triage Requires assignment of a team area label labels Jun 29, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Jun 29, 2020
@dakrone dakrone self-assigned this Jun 29, 2020
@dakrone
Copy link
Member

dakrone commented Jun 29, 2020

I was able to reproduce this, I'll work on a fix for it, thanks for reporting it!

@shotecorps
Copy link
Author

I found that it also causes ILM running error
GET dsm-1659ac4eb92711eab49d0a580a10000f/_ilm/explain
{ "indices" : { "dsm-1659ac4eb92711eab49d0a580a10000f-000001" : { "index" : "dsm-1659ac4eb92711eab49d0a580a10000f-000001", "managed" : true, "policy" : "dsm-1659ac4eb92711eab49d0a580a10000f", "lifecycle_date_millis" : 1593338812111, "age" : "2.83d", "phase" : "hot", "phase_time_millis" : 1593583491979, "action" : "rollover", "action_time_millis" : 1593338854570, "step" : "ERROR", "step_time_millis" : 1593583492008, "failed_step" : "attempt-rollover", "is_auto_retryable_error" : true, "failed_step_retry_count" : 238, "step_info" : { "type" : "illegal_state_exception", "reason" : "invalid mapping definition, expected a single map underneath [_doc] but it was: [{dynamic=false}]", "stack_trace" : """java.lang.IllegalStateException: invalid mapping definition, expected a single map underneath [_doc] but it was: [{dynamic=false}] at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.parseV2Mappings(MetadataCreateIndexService.java:580) at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.resolveV2Mappings(MetadataCreateIndexService.java:518) at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequestWithV2Template(MetadataCreateIndexService.java:495) at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequest(MetadataCreateIndexService.java:335) at org.elasticsearch.cluster.metadata.MetadataCreateIndexService.applyCreateIndexRequest(MetadataCreateIndexService.java:355) at org.elasticsearch.action.admin.indices.rollover.MetadataRolloverService.rolloverAlias(MetadataRolloverService.java:132) at org.elasticsearch.action.admin.indices.rollover.MetadataRolloverService.rolloverClusterState(MetadataRolloverService.java:97) at org.elasticsearch.action.admin.indices.rollover.TransportRolloverAction$1$1.execute(TransportRolloverAction.java:138) at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:47) at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:702) at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:324) at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:219) at org.elasticsearch.cluster.service.MasterService.access$000(MasterService.java:73) at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:151) at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:636) at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252) at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832) """ }, "phase_execution" : { "policy" : "dsm-1659ac4eb92711eab49d0a580a10000f", "phase_definition" : { "min_age" : "0ms", "actions" : { "rollover" : { "max_size" : "40gb" }, "set_priority" : { "priority" : 100 } } }, "version" : 1, "modified_date_in_millis" : 1593338811953 } } } }

GET _ilm/policy/dsm-1659ac4eb92711eab49d0a580a10000f
{ "dsm-1659ac4eb92711eab49d0a580a10000f" : { "version" : 1, "modified_date" : "2020-06-28T10:06:51.953Z", "policy" : { "phases" : { "warm" : { "min_age" : "0ms", "actions" : { "allocate" : { "number_of_replicas" : 0, "include" : { "warm" : "true" }, "exclude" : { }, "require" : { } }, "readonly" : { }, "shrink" : { "number_of_shards" : 1 }, "forcemerge" : { "max_num_segments" : 1 }, "set_priority" : { "priority" : 50 } } }, "cold" : { "min_age" : "7d", "actions" : { "freeze" : { }, "set_priority" : { "priority" : 0 } } }, "hot" : { "min_age" : "0ms", "actions" : { "rollover" : { "max_size" : "40gb" }, "set_priority" : { "priority" : 100 } } } } } } }
GET _component_template
{ "component_templates" : [ { "name" : "dsm_dft", "component_template" : { "template" : { "settings" : { "index" : { "codec" : "default", "routing" : { "allocation" : { "require" : { "hot" : "true" } } }, "refresh_interval" : "60s", "number_of_shards" : "1", "number_of_replicas" : "0" } }, "mappings" : { "dynamic" : "false" } } } } ] }

GET _index_template/dsm-1659ac4eb92711eab49d0a580a10000f
{ "index_templates" : [ { "name" : "dsm-1659ac4eb92711eab49d0a580a10000f", "index_template" : { "index_patterns" : [ "dsm-1659ac4eb92711eab49d0a580a10000f-*" ], "template" : { "settings" : { "index" : { "lifecycle" : { "name" : "dsm-1659ac4eb92711eab49d0a580a10000f", "rollover_alias" : "dsm-1659ac4eb92711eab49d0a580a10000f" }, "number_of_shards" : "2", "number_of_replicas" : "0" } }, "mappings" : { "properties" : { "EventData_CreationUtcTime" : { "type" : "keyword" }, "EventData_ShutdownActionType" : { "type" : "keyword" }, "EventData_LogonId" : { "type" : "keyword" }, "EventData_MaximumPerformancePercent" : { "type" : "keyword" }, "EventData_SubjectUserSid" : { "type" : "keyword" }, "EventData_MinimumThrottlePercent" : { "type" : "keyword" }, "EventData_LmPackageName" : { "type" : "keyword" }, "channel" : { "type" : "keyword" }, "EventData_ExtraInfo" : { "type" : "keyword" }, "EventData_Number" : { "type" : "keyword" }, "hostname" : { "type" : "keyword" }, "EventData_DwordVal" : { "type" : "keyword" }, "EventData_FailureName" : { "type" : "keyword" }, "EventData_FileVersion" : { "type" : "keyword" }, "user_type" : { "type" : "keyword" }, "EventData_BitlockerUserInputTime" : { "type" : "keyword" }, "activity_id" : { "type" : "keyword" }, "api" : { "type" : "keyword" }, "EventData_Description" : { "type" : "keyword" }, "EventData_Signed" : { "type" : "keyword" }, "EventData_RestrictedAdminMode" : { "type" : "keyword" }, "EventData_Status" : { "type" : "keyword" }, "EventData_EventIdx" : { "type" : "integer" }, "EventData_State" : { "type" : "keyword" }, "index" : { "type" : "keyword" }, "raw" : { "type" : "text" }, "EventData_Detail" : { "type" : "keyword" }, "EventData_FailureReason" : { "type" : "keyword" }, "EventData_TargetDomainName" : { "type" : "keyword" }, "EventData_DriverName" : { "type" : "keyword" }, "EventData_ImpersonationLevel" : { "type" : "keyword" }, "process_thread_id" : { "type" : "long" }, "EventData_LogonProcessName" : { "type" : "keyword" }, "version" : { "type" : "long" }, "EventData_SubjectUserName" : { "type" : "keyword" }, "EventData_FinalStatus" : { "type" : "keyword" }, "EventData_ProcessPid" : { "type" : "keyword" }, "EventData_DeviceTime" : { "type" : "keyword" }, "EventData_StartTime" : { "type" : "keyword" }, "EventData_TargetSid" : { "type" : "keyword" }, "EventData_TransmittedServices" : { "type" : "keyword" }, "EventData_IpPort" : { "type" : "keyword" }, "EventData_PreviousCreationUtcTime" : { "type" : "keyword" }, "EventData_TargetLinkedLogonId" : { "type" : "keyword" }, "rt" : { "type" : "date" }, "user_name" : { "type" : "keyword" }, "EventData_NominalFrequency" : { "type" : "keyword" }, "EventData_SignatureStatus" : { "type" : "keyword" }, "EventData_GroupMembership" : { "type" : "keyword" }, "MessageName" : { "type" : "keyword" }, "_app" : { "type" : "keyword" }, "EventData_TerminalSessionId" : { "type" : "keyword" }, "EventData_Group" : { "type" : "keyword" }, "EventData_StopTime" : { "type" : "keyword" }, "EventData_EventCountTotal" : { "type" : "integer" }, "EventData_ShutdownReason" : { "type" : "keyword" }, "provider_guid" : { "type" : "keyword" }, "EventData_ServiceName" : { "type" : "keyword" }, "EventData_SubStatus" : { "type" : "keyword" }, "provider_name" : { "type" : "keyword" }, "EventData_param1" : { "type" : "keyword" }, "EventData_DriverNameLength" : { "type" : "keyword" }, "EventData_NewTime" : { "type" : "keyword" }, "EventData_param4" : { "type" : "keyword" }, "EventData_param5" : { "type" : "keyword" }, "computer_name" : { "type" : "keyword" }, "EventData_param2" : { "type" : "keyword" }, "EventData_param3" : { "type" : "keyword" }, "EventData_IpAddress" : { "type" : "keyword" }, "EventData_TargetLogonGuid" : { "type" : "keyword" }, "EventData_param8" : { "type" : "keyword" }, "EventData_BuildVersion" : { "type" : "keyword" }, "EventData_param6" : { "type" : "keyword" }, "EventData_param7" : { "type" : "keyword" }, "EventData_CallerProcessName" : { "type" : "keyword" }, "EventData_SchemaVersion" : { "type" : "keyword" }, "EventData_Product" : { "type" : "keyword" }, "EventData_EntryCount" : { "type" : "keyword" }, "event_id" : { "type" : "keyword" }, "@timestamp" : { "type" : "date" }, "EventData_Reason" : { "type" : "keyword" }, "EventData_PuaPolicyId" : { "type" : "keyword" }, "related_activity_id" : { "type" : "keyword" }, "user_identifier" : { "type" : "keyword" }, "EventData_WorkstationName" : { "type" : "keyword" }, "EventData_CallerProcessId" : { "type" : "keyword" }, "EventData_DeviceNameLength" : { "type" : "keyword" }, "EventData_MinorVersion" : { "type" : "keyword" }, "EventData_DeviceVersionMajor" : { "type" : "keyword" }, "opcode" : { "type" : "keyword" }, "uuid" : { "type" : "keyword" }, "EventData_DeviceVersionMinor" : { "type" : "keyword" }, "EventData_FailureNameLength" : { "type" : "keyword" }, "user_domain" : { "type" : "keyword" }, "host" : { "type" : "keyword" }, "EventData_TargetServerName" : { "type" : "keyword" }, "EventData_AuthenticationPackageName" : { "type" : "keyword" }, "EventData_SubjectDomainName" : { "type" : "keyword" }, "EventData_TSId" : { "type" : "keyword" }, "EventData_LogonGuid" : { "type" : "keyword" }, "EventData_TargetInfo" : { "type" : "keyword" }, "EventData_LastBootGood" : { "type" : "keyword" }, "EventData_ShutdownEventCode" : { "type" : "keyword" }, "level" : { "type" : "keyword" }, "kind" : { "type" : "keyword" }, "EventData_OldTime" : { "type" : "keyword" }, "EventData_SubjectLogonId" : { "type" : "keyword" }, "EventData_ScriptBlockText" : { "type" : "keyword" }, "user_data" : { "type" : "text" }, "EventData_IntegrityLevel" : { "type" : "keyword" }, "process_pid" : { "type" : "long" }, "EventData_KeyLength" : { "type" : "keyword" }, "devuuid" : { "type" : "keyword" }, "EventData_MinimumPerformancePercent" : { "type" : "keyword" }, "task" : { "type" : "keyword" }, "EventData_Version" : { "type" : "keyword" }, "EventData_BootType" : { "type" : "keyword" }, "EventData_ProcessPath" : { "type" : "keyword" }, "EventData_UserSid" : { "type" : "keyword" }, "EventData_NewProcessId" : { "type" : "keyword" }, "EventData_TargetUserSid" : { "type" : "keyword" }, "EventData_LastShutdownGood" : { "type" : "keyword" }, "EventData_OriginalFileName" : { "type" : "keyword" }, "Category" : { "type" : "keyword" }, "EventData_OldSchemeGuid" : { "type" : "keyword" }, "EventData_PuaCount" : { "type" : "keyword" }, "EventData_TargetOutboundUserName" : { "type" : "keyword" }, "EventData_PrivilegeList" : { "type" : "keyword" }, "EventData_NewProcessName" : { "type" : "keyword" }, "EventData_BootMode" : { "type" : "keyword" }, "EventData_Binary" : { "type" : "keyword" }, "EventData_ElevatedToken" : { "type" : "keyword" }, "EventData_VirtualAccount" : { "type" : "keyword" }, "EventData_Workstation" : { "type" : "keyword" }, "EventData_MajorVersion" : { "type" : "keyword" }, "EventData_LogonType" : { "type" : "keyword" }, "EventData_ServiceVersion" : { "type" : "keyword" }, "@version" : { "type" : "keyword" }, "EventData_Company" : { "type" : "keyword" }, "EventData_PerformanceImplementation" : { "type" : "keyword" }, "EventData_ProcessName" : { "type" : "keyword" }, "EventData_TargetOutboundDomainName" : { "type" : "keyword" }, "EventData_IdleImplementation" : { "type" : "keyword" }, "EventData_Path" : { "type" : "keyword" }, "start" : { "type" : "date" }, "EventData_NewSchemeGuid" : { "type" : "keyword" }, "EventData_TargetUserName" : { "type" : "keyword" }, "EventData_TokenElevationType" : { "type" : "keyword" }, "EventData_DriveName" : { "type" : "keyword" }, "EventData_QfeVersion" : { "type" : "keyword" }, "message" : { "type" : "text" }, "EventData_TargetLogonId" : { "type" : "keyword" }, "record_id" : { "type" : "keyword" }, "EventData_Signature" : { "type" : "keyword" }, "EventData_DeviceName" : { "type" : "keyword" }, "EventData_IdleStateCount" : { "type" : "keyword" }, "SubCategory" : { "type" : "keyword" }, "EventData_PreviousTime" : { "type" : "keyword" }, "EventData_CorruptionActionState" : { "type" : "keyword" }, "EventData_ProcessId" : { "type" : "keyword" } } } }, "composed_of" : [ "dsm_dft" ], "priority" : 100 } } ] }

dakrone added a commit to dakrone/elasticsearch that referenced this issue Jul 1, 2020
This adds rolling upgrade tests that component and composable templates can be read from older
versions of the cluster.

Relates to elastic#58643
dakrone added a commit to dakrone/elasticsearch that referenced this issue Jul 1, 2020
This commit adds an integration test that component templates used to form a composite template can
still be updated after a cluster restart.

In elastic#58643 an issue arose where mappings were causing problems because of the way we unwrap `_doc` in
template mappings. This was also related to the mappings being merged manually rather than using the
`MapperService` to do the merging. elastic#58643 was fixed in 7.9 and master with the elastic#58521 change, since
mappings now are read and digested by the actual mapper service.

This test passes for 7.x and master, and I intend to open a separate PR including this test for
7.8.1 along with a bug fix for elastic#58643. This test is to ensure we don't have any regression in the
future.
dakrone added a commit that referenced this issue Jul 2, 2020
This commit adds an integration test that component templates used to form a composite template can
still be updated after a cluster restart.

In #58643 an issue arose where mappings were causing problems because of the way we unwrap `_doc` in
template mappings. This was also related to the mappings being merged manually rather than using the
`MapperService` to do the merging. #58643 was fixed in 7.9 and master with the #58521 change, since
mappings now are read and digested by the actual mapper service.

This test passes for 7.x and master, and I intend to open a separate PR including this test for
7.8.1 along with a bug fix for #58643. This test is to ensure we don't have any regression in the
future.
dakrone added a commit to dakrone/elasticsearch that referenced this issue Jul 2, 2020
…ic#58883)

This commit adds an integration test that component templates used to form a composite template can
still be updated after a cluster restart.

In elastic#58643 an issue arose where mappings were causing problems because of the way we unwrap `_doc` in
template mappings. This was also related to the mappings being merged manually rather than using the
`MapperService` to do the merging. elastic#58643 was fixed in 7.9 and master with the elastic#58521 change, since
mappings now are read and digested by the actual mapper service.

This test passes for 7.x and master, and I intend to open a separate PR including this test for
7.8.1 along with a bug fix for elastic#58643. This test is to ensure we don't have any regression in the
future.
dakrone added a commit that referenced this issue Jul 2, 2020
…58883) (#58914)

This commit adds an integration test that component templates used to form a composite template can
still be updated after a cluster restart.

In #58643 an issue arose where mappings were causing problems because of the way we unwrap `_doc` in
template mappings. This was also related to the mappings being merged manually rather than using the
`MapperService` to do the merging. #58643 was fixed in 7.9 and master with the #58521 change, since
mappings now are read and digested by the actual mapper service.

This test passes for 7.x and master, and I intend to open a separate PR including this test for
7.8.1 along with a bug fix for #58643. This test is to ensure we don't have any regression in the
future.
dakrone added a commit to dakrone/elasticsearch that referenced this issue Jul 2, 2020
Due to the way that our `toXContent` of mappings works, we reduce the type to remove `_doc` from
template mappings when serializing them to disk as part of cluster state. This causes problems
however, as we always expected there to be a `_doc` field in the mappings. This was resolved in
later versions of ES (7.9+) by elastic#58521 which uses a real mapper to handle the mappings. For 7.8.1,
however, we need to ensure that we can still read the state after it has been persisted to disk.

Resolves elastic#58643
Relates to elastic#58883
Relates to elastic#58521
dakrone added a commit that referenced this issue Jul 2, 2020
)

This adds rolling upgrade tests that component and composable templates can be read from older
versions of the cluster.

Relates to #58643
dakrone added a commit to dakrone/elasticsearch that referenced this issue Jul 2, 2020
…stic#58867)

This adds rolling upgrade tests that component and composable templates can be read from older
versions of the cluster.

Relates to elastic#58643
dakrone added a commit that referenced this issue Jul 6, 2020
Due to the way that our `toXContent` of mappings works, we reduce the type to remove `_doc` from
template mappings when serializing them to disk as part of cluster state. This causes problems
however, as we always expected there to be a `_doc` field in the mappings. This was resolved in
later versions of ES (7.9+) by #58521 which uses a real mapper to handle the mappings. For 7.8.1,
however, we need to ensure that we can still read the state after it has been persisted to disk.

Resolves #58643
Relates to #58883
Relates to #58521
@dakrone
Copy link
Member

dakrone commented Jul 6, 2020

This was fixed in 7.x and master by #58521 and in 7.8 (for a 7.8.1 release) by #58964, so I'm going to close this issue.

@dakrone dakrone closed this as completed Jul 6, 2020
martijnvg added a commit that referenced this issue May 4, 2021
)

Backport of #58867 to 7.x branch.

This adds rolling upgrade tests that component and composable templates can be read from older
versions of the cluster.

Relates to #58643

* Added skip versions
* Make `tests.upgrade_from_version` available to `UpgradeClusterClientYamlTestSuiteIT` and use that to skip tests based on versions.
* added jdocs

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Martijn van Groningen <[email protected]>
@nandakishorbc
Copy link

what is the fix for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team
Projects
None yet
Development

No branches or pull requests

5 participants