Skip to content

[BUG] OpenSearch source does not handle failures correctly #6337

@dlvenable

Description

@dlvenable

Describe the bug

The opensearch source considers it has completely read an index when the search results is less than the page size.

} while (searchWithSearchAfterResults.getDocuments().size() == searchConfiguration.getBatchSize());

This logic has a significant issue. If the search results failed to load a single document, the source will complete. This can happen early in an index, which leads to loading a small fraction of the documents. Or it can happen later.

Relatedly, I saw this happen when the search results included failures. These failures should be logged and counted in the metrics.

To Reproduce

None.

Expected behavior

I expect that the opensearch source should continue to read from the index as best as it can. If it fails to read some documents, it can log failure messages and report metrics.

We may also want to consider something in source coordination to indicate "completed with failures" that could be used to analyze failures.

Screenshots

N/A

Environment (please complete the following information):

Latest version of Data Prepper

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Unplanned

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions