Skip to content
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

Elasticsearch node on 7.0 alpha is not booting (Upgrade from 6.1.2) #37429

Closed
shamzeer opened this issue Jan 14, 2019 · 7 comments
Closed

Elasticsearch node on 7.0 alpha is not booting (Upgrade from 6.1.2) #37429

shamzeer opened this issue Jan 14, 2019 · 7 comments
Assignees
Labels
blocker >bug Pioneer Program :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v7.0.0-beta1

Comments

@shamzeer
Copy link

shamzeer commented Jan 14, 2019

Elasticsearch version (bin/elasticsearch --version): 7.0.0 alpha1

Plugins installed: [analysis-phonetic, ingest-attachment]

JVM version (java -version): 1.8.0.181

OS version (uname -a if on a Unix-like system): Windows 2012 R2

Description of the problem including expected versus actual behavior: We have disabled "_all" field in our mappings in ElasticSearch 6.1.2. We have created indices and indexed data into it. The following is an example of the mapping.

{
"testindex": {
"mappings": {
"type": {
"_all": {
"enabled": false
},
"properties": {
"title": {
"type": "text"
},
"description": {
"type": "text"
}
}
}
}
}
}

Everything is fine with ElasticSearch 6.1.2. But when we upgrade to Elasticsearch 7.0.0 alpha 1, ElasticSearch boot up failed with the following error.

org.elasticsearch.index.mapper.MapperParsingException: Root mapping definition has unsupported parameters: [_all : {enabled=false}]

Is there a way to ignore it (_all) while booting up?
Or is there a way to update the mapping to remove the _all field?

Looking for a solution other than mandating re-index of data.

Please provide your suggestions. Thanks.

@gwbrown gwbrown added >bug :Search Foundations/Mapping Index mappings, including merging and defining field types labels Jan 14, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@dakrone dakrone self-assigned this Jan 14, 2019
@dakrone
Copy link
Member

dakrone commented Jan 15, 2019

Thanks for bringing this up @shamzeer, I'm working on a fix for this for 7.0

@shamzeer
Copy link
Author

Thanks very much for considering this.

@dakrone dakrone removed their assignment Jan 16, 2019
@dakrone
Copy link
Member

dakrone commented Jan 16, 2019

Notes:

I originally thought we would be able to drop the _all mapping inside of DocumentMapperParser to work around the exception, however, this doesn't actually change the serialized value. What happens later is that then when we go to check if the mapping needs to be updated, the _all is still there in the compressed xcontent bytes, which causes the mapping to think it needs to be updated again, causing an assertion to trip.

My branch with the fix and unit test as well as rolling upgrade test (which fails) is at

master...dakrone:allow-underscore-all-in-mapping

@jimczi jimczi self-assigned this Jan 16, 2019
@jpountz
Copy link
Contributor

jpountz commented Jan 22, 2019

@dakrone The approach looks good to me. I would just ensure that enabled is actually false when removing _all from the map? Can you open a PR and assign me as a reviewer?

@jimczi
Copy link
Contributor

jimczi commented Jan 22, 2019

@jpountz, we agreed with @dakrone that the @elastic/es-search team will handle this issue ;)
I'll open a new pr with the approach that @dakrone took and let's discuss the failing upgrade test there.

jimczi added a commit to jimczi/elasticsearch that referenced this issue Jan 24, 2019
This commit restores a noop version of the AllFieldMapper that is instanciated only
for indices created in 6x. We need this metadata field mapper to be present in this version
in order to allow the upgrade of indices that explicitly disable _all (enabled: false).
The mapping of these indices contains a reference to the _all field that we cannot remove
in 7 so we'll need to keep this metadata mapper in 7x. Since indices created in 6x will not
be compatible with 8, we'll remove this noop mapper in the next major version.

Closes elastic#37429
jimczi added a commit that referenced this issue Jan 30, 2019
This commit restores a noop version of the AllFieldMapper that is instanciated only
for indices created in 6x. We need this metadata field mapper to be present in this version
in order to allow the upgrade of indices that explicitly disable _all (enabled: false).
The mapping of these indices contains a reference to the _all field that we cannot remove
in 7 so we'll need to keep this metadata mapper in 7x. Since indices created in 6x will not
be compatible with 8, we'll remove this noop mapper in the next major version.

Closes #37429
@markwalkom
Copy link
Contributor

@shamzeer we'd like to thank you for your contribution to 7.0! do you mind dropping an email to [email protected] so we can arrange to send you out a gift? :)

@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker >bug Pioneer Program :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v7.0.0-beta1
Projects
None yet
Development

No branches or pull requests

9 participants