Skip to content

ESQL: 200 even if all shards fail due to bug - partial failure behavior inconsistent with _search #128311

@astefan

Description

@astefan

Description

This is a theoretical failure that's only possible if an explicit failure is thrown on purpose from LocalMapper class.
If the LocalMapper.map(LogicalPlan p) method is changed like below

......
        if (p instanceof BinaryPlan binary) {
            //return mapBinary(binary);
            return MapperUtils.unsupported(binary);
        }
.......

The following query

FROM employees
| sort first_name
| EVAL language_code = languages
| LOOKUP JOIN languages_lookup ON language_code
| WHERE emp_no >= 10091 AND emp_no < 10094
| SORT language_name
| MV_EXPAND first_name
| SORT first_name
| MV_EXPAND last_name
| SORT last_name
| LOOKUP JOIN languages_lookup ON language_code
| SORT emp_no
| KEEP emp_no, language_code, language_name

taken from lookup-join.csv-spec executed in format txt (ie /_query?format=txt&error_trace=true) will execute successfully and return a list of columns with no data:

    emp_no     | language_code | language_name 
---------------+---------------+---------------

If the same query is executed with json output format (ie /_query?format=json&error_trace=true) the error is now visible and the response is considered "partial":

{
    "took": 15,
    "is_partial": true,
    "documents_found": 0,
    "values_loaded": 0,
    "columns": [
        {
            "name": "emp_no",
            "type": "integer"
        },
        {
            "name": "language_code",
            "type": "integer"
        },
        {
            "name": "language_name",
            "type": "keyword"
        }
    ],
    "values": [],
    "_clusters": {
        "details": {
            "(local)": {
                "status": "partial",
                "indices": "employees",
                "took": 15,
                "_shards": {
                    "total": 1,
                    "successful": 0,
                    "skipped": 0,
                    "failed": 1
                },
                "failures": [
                    {
                        "shard": 0,
                        "index": "employees",
                        "node": null,
                        "reason": {
                            "type": "esql_illegal_argument_exception",
                            "reason": "unsupported logical plan node [Join]"
                        }
                    }
                ]
            }
        }
    }
}

Metadata

Metadata

Assignees

Labels

:Analytics/ES|QLAKA ESQL>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)blockerstatefulMarking issues only relevant for stateful releases

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions