Skip to content

ESQL: Change queries ID to be the same as the async #127472

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

GalLalouche
Copy link
Contributor

This PR changes the list and query API for ESQL, such that the ID now follows the same format as async query IDs. This is saved as part of the task status. For async queries, this is easy, but for sync queries, this is slightly more complicated, since when creating them, we don't have access to a node ID. So instead, the status itself is just the doc ID portion of the async execution ID, which is used for salting, since this part needs to be consistent, so that when we list the queries, we can compute the async execution ID correctly.

Also, I've removed the individual ID, node, and data node tags, as mentioned in the ticket.

Resolves #127187

Also the individual ID, node, and data node tags.

GitHub: Resolves elastic#127187
@GalLalouche GalLalouche added >feature Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL v9.1.0 labels Apr 28, 2025
@GalLalouche GalLalouche requested a review from nik9000 April 28, 2025 15:41
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @GalLalouche, I've created a changelog YAML for you.

@GalLalouche GalLalouche requested a review from nik9000 April 29, 2025 15:14
}

public static AsyncExecutionId readFrom(StreamInput input) throws IOException {
return decode(input.readString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth adding an AbstractWireTestCase subclass for this then.

@Override
public Status getStatus() {
return status;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's probably worth making this a concrete class with a name and stuff.

Could you put the doc id as a member and return a status that's xcontent renders like:

{
  "request_id": "<the encoded request id we'd get from the list api"
}

That way we can see the whole encoded blob in the tasks list api and folks won't wonder what that random thing means in the status?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we don't have the local node id here - but we could pass it in to this method. You'd have to modify the 30 implementers, but I guess that's ok.

@@ -3,6 +3,7 @@
"id" : 5326,
"type" : "transport",
"action" : "indices:data/read/esql",
"status" : "Ks5ApyqMTtWj5LrKigmCjQ",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this so high in the PR really helped review it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >feature Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESQL: Get and list APIs should use async execution id format
3 participants