Skip to content

[TSDB] Error: the document timestamp X is outside of ranges of currently writable indices #7345

@constanca-m

Description

@constanca-m

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:

  1. 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:
    1. Go to the manifest.yml file.
    2. 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.

  2. Update the timestamp of the document being rejected.
    Cons of this approach:
    • Updating the document timestamp might cause us to loose important data.
  3. Find a fix to receive the document without a delay.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions