-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Cast exception error while using the get api #57462
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
Comments
Pinging @elastic/es-search (:Search/Search) |
Pinging @elastic/es-distributed (:Distributed/Engine) |
Thank you @cristi- for the detailed report. Since you've already dug in and identified the likely cause (which is great), would you be interested in submitting a PR? No worries if not, I can submit a fix soon. |
@jtibshirani thank you for the suggestion, I can try opening a PR to fix this. I was thinking of checking numeric types first and then strings as the final check. Would that be the right direction? I'll try to add a test too. |
Not at all @ywelsch , glad to see this fixed 👍 |
Using realtime get on numeric fields when reading from the translog would yield a ClassCastException. Closes #57462
Using realtime get on numeric fields when reading from the translog would yield a ClassCastException. Closes #57462
Using realtime get on numeric fields when reading from the translog would yield a ClassCastException. Closes #57462
Elasticsearch version (
bin/elasticsearch --version
):7.6.0
Plugins installed: [analysis-icu analysis-kuramoji es-restlog es-shopname-tokenizer repository-gcs]
JVM version (
java -version
):openjdk version "13.0.2" 2020-01-14
OS version (
uname -a
if on a Unix-like system):Linux elastic2-es-data-14 4.14.138+ #1 SMP Tue Sep 3 02:58:08 PDT 2019 x86_64 x86_64 x86_64 GNU/Linux
Description of the problem including expected versus actual behavior:
From time to time, while retrieving documents using the GET Api from a index that receives no search requests, we see the following exception:
The index has the following mapping:
The changes added in #48843 used the following logic to parse data from translog files: https://github.com/elastic/elasticsearch/pull/48843/files#diff-04af9607316b0935c611e5ebfd5e7c61R256-R265
However in https://github.com/apache/lucene-solr/blob/a6a02ac0e5116f4cf061fd3afeb930c3cc379f5a/lucene/core/src/java/org/apache/lucene/document/Field.java#L252-L264
stringValue()
will return thefieldsData.toString();
even for numeric values.This string value reaches valueForDisplay() where the exception occurs:
Steps to reproduce:
Unfortunately I don't have a easy way to reproduce this right now.
Provide logs (if relevant):
The text was updated successfully, but these errors were encountered: