elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.12k stars 24.83k forks source link

ESQL: Improve error reporting when trying to use a new feature against an old version that doesn't have it #113110

Open nik9000 opened 1 month ago

nik9000 commented 1 month ago

Description

For example, when you use union types in an 8.15 cluster against an 8.14 cluster you'll see really slow reply and, eventually, a Unknown readable [org.elasticsearch.xpack.ql.type.EsField][MultiTypeEsField].

This is an axis of testing the ES hasn't done a lot with in the past - we typically skip tests for new features in a cluster that doesn't support them. But we'd really like to make sure that the error reporting is OK when you do this.

It'd be nice to solve this problem in CCS and rolling-upgrade clusters for union types now, but we also need to come up with a general strategy for testing. I think the VersionedNamedWriteable is probably a good one to reach for to solve this problem on the production side. But testing is much more complex I think. Especially testing the general problem.

elasticsearchmachine commented 1 month ago

Pinging @elastic/es-analytical-engine (Team:Analytics)

nik9000 commented 1 month ago

Image Image Image

We could use VersionedNamedWriteable to fix this. Testing it's harder, but now that we're using NamedWriteable for much of ESQL it's pretty low effort to pick up VersionedNamedWriteable and not test the error message beyond a unit test for any VersionedNamedWriteable in the plan. Our regular tests make sure we're not accidentally disallowing the new thing with a bad version. Not having an integration test for the error message feels ok here - at worst you get the error message we have now.