opensearch-project / opensearch-project/data-prepper
[BUG] OpenSearch sink is not resuming after failures
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 374
- Forks
- 354
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
Describe the bug
We have noticed that failures writing to the OpenSearch sink may result in the opensearch sink failing to continue to write, even after the issue is resolved.
To Reproduce
- Create this pipeline
opensearch-retry-pipeline:
workers: 2
delay: 100
source:
http:
sink:
- opensearch:
hosts: [ "https://opensearch:9200" ]
insecure: true
username: admin
password: admin
index: test_forbidden
- Write a message.
curl http://localhost:2021/log/ingest -X POST -H 'Content-Type: application/json' -d '[{"test": "hello"}]'
- Search - the new document is available
GET test_forbidden/_search
{
"query": {
"match_all": {}
}
}
- Add a write block
PUT test_forbidden/_block/write?timeout=30m
- Write more messages
curl http://localhost:2021/log/ingest -X POST -H 'Content-Type: application/json' -d '[{"test": "hello2"}]'
curl http://localhost:2021/log/ingest -X POST -H 'Content-Type: application/json' -d '[{"test": "hello3"}]'
curl http://localhost:2021/log/ingest -X POST -H 'Content-Type: application/json' -d '[{"test": "hello4"}]'
- Search - no new documents
GET test_forbidden/_search
{
"query": {
"match_all": {}
}
}
Also, see Data Prepper logs
data-prepper | 2024-09-10T18:24:11,693 [opensearch-retry-pipeline-sink-worker-2-thread-2] WARN org.opensearch.dataprepper.plugins.sink.opensearch.BulkRetryStrategy - operation = Index, error = index [test_forbidden] blocked by: [FORBIDDEN/8/index write (api)];
- Remove the write block
PUT test_forbidden/_settings
{
"index.blocks.read_only_allow_delete": null
}
- Search
GET test_forbidden/_search
{
"query": {
"match_all": {}
}
}
At this point, we should see new documents. But, they are not present.
Expected behavior
At step 8, we should see the documents.
Environment (please complete the following information):
Data Prepper 2.9.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OpenSearch sink's BulkRetryStrategy, which is named in the Data Prepper warning, and reproduce the failure using the opensearch-retry-pipeline configuration and the listed OpenSearch block and unblock requests. Done means messages written after the write block is removed are eventually indexed and visible in the search results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100