opensearch-project / opensearch-project/data-prepper

[BUG] OpenSearch sink is not resuming after failures

Open
#4,932 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

  1. 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
  1. Write a message.
curl http://localhost:2021/log/ingest -X POST -H 'Content-Type: application/json' -d '[{"test": "hello"}]'
  1. Search - the new document is available
GET test_forbidden/_search
{
  "query": {
    "match_all": {}
  }
}
  1. Add a write block
PUT test_forbidden/_block/write?timeout=30m
  1. 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"}]'
  1. 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)];
  1. Remove the write block
PUT test_forbidden/_settings
{
  "index.blocks.read_only_allow_delete": null
}
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.