Enabling TSDB on some data streams can lead to this error:
... (status=400): {"type":"illegal_argument_exception","reason":"the document timestamp [2023-08-07T00:00:00.000Z] is outside of ranges of currently writable indices [[2023-08-07T08:55:38.000Z,2023-08-07T12:55:38.000Z]]"}, dropping event!
Having a look at how the time window works for a TSDB index, we can see that:
A TSDS is designed to ingest current metrics data. When the TSDS is first created the initial backing index has:
- an index.time_series.start_time value set to now - index.look_ahead_time
- an index.time_series.end_time value set to now + index.look_ahead_time
Only data that falls inside that range can be indexed.
But what happens if we receive a document with some delay, and the document timestamp no longer fits the time window of the current writable index? The document ends up being rejected.
To solve this issue, we have on the table this options:
- Define the
look_ahead for each data stream.
Cons of this approach:
- When does the customization stop for a time window?
How to do this:
- Go to the
manifest.yml file.
- Add the following:
elasticsearch:
index_mode: "time_series"
index_template:
settings:
index.look_ahead_time: "10h"
Note: Updating the package with this does not cause an automatic rollover on the data stream. You have to do that manually.
- Update the
timestamp of the document being rejected.
Cons of this approach:
- Updating the document timestamp might cause us to loose important data.
- Find a fix to receive the document without a delay.
Enabling TSDB on some data streams can lead to this error:
Having a look at how the time window works for a TSDB index, we can see that:
But what happens if we receive a document with some delay, and the document
timestampno longer fits the time window of the current writable index? The document ends up being rejected.To solve this issue, we have on the table this options:
look_aheadfor each data stream.Cons of this approach:
How to do this:
manifest.ymlfile.timestampof the document being rejected.Cons of this approach: