Skip to content

TSDB: improve document description on error#84903

Merged
elasticsearchmachine merged 6 commits intoelastic:masterfrom
nik9000:tsdb_auto_id_message
Mar 14, 2022
Merged

TSDB: improve document description on error#84903
elasticsearchmachine merged 6 commits intoelastic:masterfrom
nik9000:tsdb_auto_id_message

Conversation

@nik9000
Copy link
Copy Markdown
Member

@nik9000 nik9000 commented Mar 11, 2022

When a document fails to index we'd previously return an error with the
description:

failed to parse field [a] of type [integer] in document with id 'null'. Preview of field's value: 'not_an_int'

That with id 'null' thing is kind of unfortunate. The document will
have an id. We just don't know it. So now it says:

"failed to parse field [a] of type [integer] in a time series document. Preview of field's value: 'not_an_int'"

It's be nice to put the @timestamp and the _tsid if we have it. But
we mostly won't.

@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Mar 11, 2022
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@nik9000
Copy link
Copy Markdown
Member Author

nik9000 commented Mar 11, 2022

I've added a bunch of reviewers. I think any one is probably ok.

A point of conversation: we could use this infrastructure to improve the error messages generated when we fail to parse documents in standard mode with an auto-generated id. It'd be a little more complicated than this change, but not much frankly.

nik9000 added 2 commits March 11, 2022 08:08
When a document fails to index we'd previously return an error with the
description:
```
failed to parse field [a] of type [integer] in document with id 'null'. Preview of field's value: 'not_an_int'
```

That `with id 'null'` thing is kind of unfortunate. The document *will*
have an id. We just don't know it. So now it says:
```
"failed to parse field [a] of type [integer] in a time series document. Preview of field's value: 'not_an_int'"
```

It's be nice to put the `@timestamp` and the `_tsid` if we have it. But
we mostly won't.
Copy link
Copy Markdown
Contributor

@romseygeek romseygeek left a comment

Choose a reason for hiding this comment

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

LGTM! I left a couple of nits, but no re-review required.

…rse.java

Co-authored-by: Alan Woodward <romseygeek@gmail.com>
@nik9000 nik9000 added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Mar 14, 2022
@nik9000
Copy link
Copy Markdown
Member Author

nik9000 commented Mar 14, 2022

LGTM! I left a couple of nits, but no re-review required.

Thanks! I've merged your suggestion and added the comment you mentioned. And I'll let the robot merge it once everything is checked.

Copy link
Copy Markdown
Contributor

@imotov imotov left a comment

Choose a reason for hiding this comment

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

LGTM, but I think if we could at least extract the timestamp, it would have help to significantly reduce the scope of documents that you need to potentially check.

* folks really want to to see is the dimensions and timestamp. And
* those too aren't available until after we've parsed the document.
*/
return "a time series document";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think specifying a timestamp here might be really helpful.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👍

I was thinking we could include the tsid and the timestamp if we have it but I didn't want to make this even more complex. I'll open a follow up once this is in and happy.

@elasticsearchmachine elasticsearchmachine merged commit 235dc5b into elastic:master Mar 14, 2022
@nik9000 nik9000 deleted the tsdb_auto_id_message branch March 14, 2022 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >non-issue :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants