Skip to content
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

Timestamp parsing in ElasticSearch API Issues #502

Open
gjacoby126 opened this issue Mar 13, 2023 · 2 comments
Open

Timestamp parsing in ElasticSearch API Issues #502

gjacoby126 opened this issue Mar 13, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@gjacoby126
Copy link
Contributor

I recently tried to query the KalDB version of ElasticSearch's msearch library and got an HTTP 500 back. Upon looking at the server logs, I found a NullPointerException coming from OpenSearchRequest.getStartTimeEpochMs.

return body.get("query").findValue("gte").asLong();

The root cause was that my query didn't have a required timestamp range. This is a reasonable restriction, but the existing logic has some issues:

  1. The query parsing shouldn't create an NPE, which leads to an HTTP 500 response, which is incorrect. (It should be a 400 Bad Request, or similar, because the actual problem was my query. )
  2. It would be preferable for KalDB to return a helpful error message to the client explaining that the timestamp range filter is required.
  3. The existing logic assumes that any use of "gte" is start timestamp filter. What if a user is filtering start timestamp by "gt" or "eq" instead?
  4. The existing logic assumes that any use of "lte" is the end timestamp filter. What if a user is filtering end timestamp by "lt" or "eq"?
  5. What if a user is submitting a more complex ElasticSearch query with range filters on multiple fields? There's currently no logic ensuring that the "gte" or "lte" found corresponds to the timestamp field that KalDB is using as a partition key. The "findValue" Jackson method will return the first instance found.
@bryanlb bryanlb added the bug Something isn't working label Jul 26, 2023
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Mar 10, 2024
@bryanlb
Copy link
Contributor

bryanlb commented Mar 12, 2024

This is related to #798

@github-actions github-actions bot removed the Stale label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants