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
Describe the bug
The
opensearchsource considers it has completely read an index when the search results is less than the page size.data-prepper/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/source/opensearch/worker/PitWorker.java
Line 222 in 3cc41b7
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
opensearchsource 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