Elasticsearch version (bin/elasticsearch --version): 7.5.1 7.10.1
Plugins installed: [] None
JVM version (java -version): java version "12" 2019-03-19
OS version (uname -a if on a Unix-like system): Darwin Kernel Version 19.6.0
Description of the problem including expected versus actual behavior:
During the rolling upgrade from 7.5.1 to 7.10.1, all existing queries should be successfully executed.
But exception occurred:
Steps to reproduce:
Please include a minimal but complete recreation of the problem,
including (e.g.) index creation, mappings, settings, query etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.
- create 7.5.1 cluster, node number >= 2
- create index: number_of_shards must greater than 1,with a field store timestamp as long type
PUT test_sql_query
{
"settings" : {
"number_of_shards" : 10,
"number_of_replicas" : 0
},
"mappings":{
"properties" : {
"__timestamp__":{
"type": "long"
},
"event":{
"type" : "long"
}
}
}
}
- index some data
POST _bulk
{"index":{"_index":"test_sql_query"}}
{"__timestamp__":"1632723340", "event":"1"}
{"index":{"_index":"test_sql_query"}}
{"__timestamp__":"1632723330", "event":"2"}
{"index":{"_index":"test_sql_query"}}
{"__timestamp__":"1632722330", "event":"2"}
'
- Perform a rolling upgrade. When some nodes are 7.5.1 and some nodes are 7.10.1, following query request is executed:
# send request to 7.5.1 node
GET /_sql
{
"query":"SELECT HISTOGRAM(CAST(__timestamp__ AS TIMESTAMP), INTERVAL 1 MINUTE) AS time, count(DISTINCT (event)) AS events FROM test_sql_query GROUP BY time ORDER BY time "
}
# get the error:
{
"error" : {
"root_cause" : [
{
"type" : "script_exception",
"reason" : "compile error",
"script_stack" : [
"... st(InternalSqlScriptUtils.docValue(doc,params.v0), ...",
" ^---- HERE"
],
"script" : "InternalSqlScriptUtils.cast(InternalSqlScriptUtils.docValue(doc,params.v0),params.v1)",
"lang" : "painless"
}
],
"type" : "search_phase_execution_exception",
"reason" : "Partial shards failure",
"phase" : "query",
"grouped" : true,
"failed_shards" : [
{
"shard" : 2,
"index" : "test_sql_query",
"node" : "XRdI1ELjStaaMMPEjHhg0A",
"reason" : {
"type" : "script_exception",
"reason" : "compile error",
"script_stack" : [
"... st(InternalSqlScriptUtils.docValue(doc,params.v0), ...",
" ^---- HERE"
],
"script" : "InternalSqlScriptUtils.cast(InternalSqlScriptUtils.docValue(doc,params.v0),params.v1)",
"lang" : "painless",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "static method [org.elasticsearch.xpack.sql.expression.function.scalar.whitelist.InternalSqlScriptUtils, docValue/2] not found"
}
}
}
]
},
"status" : 400
}
# send request to 7.10.1 node, then get the error:
{
"error" : {
"root_cause" : [
{
"type" : "script_exception",
"reason" : "compile error",
"script_stack" : [
"... ernalSqlScriptUtils.cast(InternalQlScriptUtils.doc ...",
" ^---- HERE"
],
"script" : "InternalSqlScriptUtils.cast(InternalQlScriptUtils.docValue(doc,params.v0),params.v1)",
"lang" : "painless"
}
],
"type" : "search_phase_execution_exception",
"reason" : "Partial shards failure",
"phase" : "query",
"grouped" : true,
"failed_shards" : [
{
"shard" : 0,
"index" : "test_sql_query",
"node" : "olrpxVgOQ3ioZAYvn5ZHqw",
"reason" : {
"type" : "script_exception",
"reason" : "compile error",
"script_stack" : [
"... ernalSqlScriptUtils.cast(InternalQlScriptUtils.doc ...",
" ^---- HERE"
],
"script" : "InternalSqlScriptUtils.cast(InternalQlScriptUtils.docValue(doc,params.v0),params.v1)",
"lang" : "painless",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "Variable [InternalQlScriptUtils] is not defined."
}
}
}
]
},
"status" : 400
}
Provide logs (if relevant):
(No logs are generated in the background)
Elasticsearch version (
bin/elasticsearch --version): 7.5.1 7.10.1Plugins installed: [] None
JVM version (
java -version): java version "12" 2019-03-19OS version (
uname -aif on a Unix-like system): Darwin Kernel Version 19.6.0Description of the problem including expected versus actual behavior:
During the rolling upgrade from 7.5.1 to 7.10.1, all existing queries should be successfully executed.
But exception occurred:
Steps to reproduce:
Please include a minimal but complete recreation of the problem,
including (e.g.) index creation, mappings, settings, query etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.
PUT test_sql_query { "settings" : { "number_of_shards" : 10, "number_of_replicas" : 0 }, "mappings":{ "properties" : { "__timestamp__":{ "type": "long" }, "event":{ "type" : "long" } } } }POST _bulk {"index":{"_index":"test_sql_query"}} {"__timestamp__":"1632723340", "event":"1"} {"index":{"_index":"test_sql_query"}} {"__timestamp__":"1632723330", "event":"2"} {"index":{"_index":"test_sql_query"}} {"__timestamp__":"1632722330", "event":"2"} 'Provide logs (if relevant):
(No logs are generated in the background)