Elasticsearch Version
8.19.4+
Installed Plugins
No response
Java Version
bundled
OS Version
NA
Problem Description
When creating a scroll across indices created in different version of ES we encounter a bug where LONG is used for sorting in this specific case in 8.18.3 but in newer indices after 8.19.4 an INT is used as part of sorting optimizations done here: #127968
This causes class cast exceptions.
Steps to Reproduce
- create two indices one on 8.18.3 and one on 8.19.4 with sortable field
- attempt to query across both with a sort in the query
Logs (if relevant)
Caused by: org.elasticsearch.search.query.QueryPhaseExecutionException: Query Failed [Failed to execute main query]
Caused by: org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper: class_cast_exception: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
], cause [org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper: class_cast_exception: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
]
at org.elasticsearch.server@9.1.4/org.elasticsearch.action.search.SearchScrollAsyncAction.onShardFailure(SearchScrollAsyncAction.java:286)
at org.elasticsearch.server@9.1.4/org.elasticsearch.action.search.SearchScrollAsyncAction$1.onFailure(SearchScrollAsyncAction.java:194)
at org.elasticsearch.server@9.1.4/org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:54)
at org.elasticsearch.server@9.1.4/org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:598)
at org.elasticsearch.server@9.1.4/org.elasticsearch.transport.TransportService$UnregisterChildTransportResponseHandler.handleException(TransportService.java:1705)
at org.elasticsearch.server@9.1.4/org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1485)
...
Caused by: org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper: class_cast_exception: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
Elasticsearch Version
8.19.4+
Installed Plugins
No response
Java Version
bundled
OS Version
NA
Problem Description
When creating a scroll across indices created in different version of ES we encounter a bug where LONG is used for sorting in this specific case in 8.18.3 but in newer indices after 8.19.4 an INT is used as part of sorting optimizations done here: #127968
This causes class cast exceptions.
Steps to Reproduce
Logs (if relevant)