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
Snapshot Restoration Causes a NullPointerException on Indices that Include a Null Timestamp Default #9426
Comments
You are hitting the same issue seen in #9204 which will be fixed in 1.4.3. |
I think you mean its the same issue as #9223 and be1610b? However, does the code for the mapper now ignore |
Hmm. You meant that instead of: } else if (fieldName.equals("default") && fieldNode != null) {
defaultTimestamp = fieldNode.toString();
} we should write the following? } else if (fieldName.equals("default") && fieldNode != null) {
if (fieldNode == null) {
defaultTimestamp = null;
} else {
defaultTimestamp = fieldNode.toString();
}
} |
Yeah, pretty much. If } else if (fieldName.equals("default")) {
defaultTimestamp = null == fieldNode ? null : fieldNode.toString();
} |
Yeah exactly. Was testing that in the mean time. PR coming... Thanks for raising that. |
When creating an index with: ``` PUT new_index { "mappings": { "power": { "_timestamp" : { "enabled" : true, "default": null } } } } ``` When restarting the cluster, `now` is applied instead of `null`. So index become: ``` { "mappings": { "power": { "_timestamp" : { "enabled" : true, "default": "now" } } } } ``` This PR fix that and applies `null` when it was explicitly set. Note that this won't happen anymore in 1.5 as `null` is not allowed anymore as a `default` value. See elastic#9104. See also: * elastic#7036 * elastic#9049 * elastic#9426#issuecomment-71534871
When creating an index with: ``` PUT new_index { "mappings": { "power": { "_timestamp" : { "enabled" : true, "default": null } } } } ``` When restarting the cluster, `now` is applied instead of `null`. So index become: ``` { "mappings": { "power": { "_timestamp" : { "enabled" : true, "default": "now" } } } } ``` This PR fix that and applies `null` when it was explicitly set. Note that this won't happen anymore in 1.5 as `null` is not allowed anymore as a `default` value. See elastic#9104. See also: * elastic#7036 * elastic#9049 * elastic#9426#issuecomment-71534871
I have a field with a
null
default_timestamp
value and when I try to restore from a snapshot I get a server error caused by aNullPointerException
.Looks like the
default
timestamp value is not checked to see if it's null: https://github.com/elasticsearch/elasticsearch/blob/v1.4.2/src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java#L358I had another issue with a similar thing (#9204), maybe there's other timestamp related bugs floating around?
Stack trace:
To reproduce:
The text was updated successfully, but these errors were encountered: