-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Closed
Labels
:Distributed/Snapshot/RestoreAnything directly related to the `_snapshot/*` APIsAnything directly related to the `_snapshot/*` APIs:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>bugTeam:DistributedMeta label for distributed team.Meta label for distributed team.Team:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Description
Elasticsearch Version
7.14.2, 7.17.0 (probably earlier too)
Installed Plugins
No response
Java Version
bundled
OS Version
not relevant
Problem Description
If a user accidentally ingests JSON documents which have weird/malformed bodies, the generated mappings due to dynamic mapping will make the snapshot of the index fail on restore.
This can happen also during ILM (when the index is moved to mounted phases when using searchable snapshots) or during a normal snapshot restore operation.
Steps to Reproduce
DELETE myverybadindex
PUT myverybadindex
{
"mappings": {
"properties": {
"query": {
"properties": {
"1": {
"type": "text"
},
"\u0000": {
"type": "text"
},
"\u0000\u0000\u0000\u0000": {
"type": "text"
}
}
}
}
}
}
POST _snapshot/found-snapshots/myverybadsnapshot
{
"indices": "myverybadindex",
"include_global_state": false
}
GET _snapshot/found-snapshots/myverybadsnapshot
POST /_snapshot/found-snapshots/myverybadsnapshot/_mount?wait_for_completion=true
{
"index": "myverybadindex",
"renamed_index": "myverybadindex-mounted",
"ignore_index_settings": [ "index.refresh_interval" ]
}
POST /_snapshot/found-snapshots/myverybadsnapshot/_restore
{
"indices": "myverybadindex",
"rename_pattern": "(.+)"
, "rename_replacement": "restored_index_$1"
}
Both mounting and restore operations end up with:
{
"error" : {
"root_cause" : [
{
"type" : "i_o_exception",
"reason" : "Duplicate field '\u0000'\n at [Source: (org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat$DeserializeMetaBlobInputStream); line: -1, column: 431]"
}
],
"type" : "i_o_exception",
"reason" : "Duplicate field '\u0000'\n at [Source: (org.elasticsearch.repositories.blobstore.ChecksumBlobStoreFormat$DeserializeMetaBlobInputStream); line: -1, column: 431]"
},
"status" : 500
}
This can happen also during ILM (when the index is moved to mounted phases when using searchable snapshots).
Logs (if relevant)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Distributed/Snapshot/RestoreAnything directly related to the `_snapshot/*` APIsAnything directly related to the `_snapshot/*` APIs:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>bugTeam:DistributedMeta label for distributed team.Meta label for distributed team.Team:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch