-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Setting empty string as null_value in date field breaks 7.9 upgrade #62363
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
Labels
>bug
:Search Foundations/Mapping
Index mappings, including merging and defining field types
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
Comments
Pinging @elastic/es-search (:Search/Mapping) |
romseygeek
added a commit
that referenced
this issue
Sep 17, 2020
In #57666 we changed when null_value was parsed for ip and date fields. Previously, the null value was stored as a string, and parsed into a date or InetAddress whenever a document containing a null value was encountered. Now, the values are parsed when the mappings are built, which means that bad values are detected up front; if you try and add a mapping with a badly-parsed ip or date for a null_value, the mapping will be rejected. This causes problems for upgrades in the case when you have a badly-formed null_value in a pre-7.9 cluster. This commit fixes the upgrade case by changing the logic to only fail on indexes created in 8x and later. For earlier indexes, we log a warning on the badly formed value and ignore it, replicating the earlier behaviour. Fixes #62363
romseygeek
added a commit
that referenced
this issue
Sep 17, 2020
In #57666 we changed when null_value was parsed for ip and date fields. Previously, the null value was stored as a string, and parsed into a date or InetAddress whenever a document containing a null value was encountered. Now, the values are parsed when the mappings are built, which means that bad values are detected up front; if you try and add a mapping with a badly-parsed ip or date for a null_value, the mapping will be rejected. This causes problems for upgrades in the case when you have a badly-formed null_value in a pre-7.9 cluster. This commit fixes the upgrade case by changing the logic to only logging a warning on the badly formed value, replicating the earlier behaviour. Fixes #62363
romseygeek
added a commit
that referenced
this issue
Sep 17, 2020
In #57666 we changed when null_value was parsed for ip and date fields. Previously, the null value was stored as a string, and parsed into a date or InetAddress whenever a document containing a null value was encountered. Now, the values are parsed when the mappings are built, which means that bad values are detected up front; if you try and add a mapping with a badly-parsed ip or date for a null_value, the mapping will be rejected. This causes problems for upgrades in the case when you have a badly-formed null_value in a pre-7.9 cluster. This commit fixes the upgrade case by changing the logic to only logging a warning on the badly formed value, replicating the earlier behaviour. Fixes #62363
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Search Foundations/Mapping
Index mappings, including merging and defining field types
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
Elasticsearch version (
bin/elasticsearch --version
): 7.9.XPlugins installed: []
JVM version (
java -version
):OS version (
uname -a
if on a Unix-like system):Related to: #61712
Description of the problem including expected versus actual behavior:
7.9.X upgrade is broken when there are indexes with
"null_value": ""
in their mappings.Steps to reproduce:
In 7.8 (or earlier) create an index with the following mappings:
That didn't return any warning/error message...
Then when trying to upgrade to 7.9..X, ES is unable to upgrade the mappings for the testindex1, and exits.
Provide logs (if relevant):
Logs after ES has been upgraded to 7.9.1:
The text was updated successfully, but these errors were encountered: