opensearch-project / opensearch-project/data-prepper
[BUG] DynamoDB source shard does not exist results in stuck pipeline
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 374
- Forks
- 354
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
Describe the bug
There are times when this error is received by the DynamoDB source when it is getting a shard iterator for a shard (https://github.com/opensearch-project/data-prepper/blob/9f778dde31ca25ce69ebd61bcd97b6a6c1c4cd3b/data-prepper-plugins/dynamodb-source/src/main/java/org/opensearch/dataprepper/plugins/source/dynamodb/stream/ShardConsumerFactory.java#L170)
2024-04-01T21:32:04.221 [pool-13-thread-4] ERROR org.opensearch.dataprepper.plugins.source.dynamodb.stream.ShardConsumerFactory - Exception when trying to get the shard iterator due to Requested resource not found: Shard does not exist (Service: DynamoDbStreams, Status Code: 400, Request ID: CBIRSDQC1HK3F07CNNNAJ1EOBBVV4KQNSO5AEMVJF66Q9ASUAAJG)
To Reproduce
Have not recreated, but suspicion is that this is due to acknowledgments not being received for shards, and leads to retrying the shard for 24 hours until it expires. However, the pipeline should recover after this, but it does not even though the partition is marked as completed when this error is hit (https://github.com/opensearch-project/data-prepper/blob/9f778dde31ca25ce69ebd61bcd97b6a6c1c4cd3b/data-prepper-plugins/dynamodb-source/src/main/java/org/opensearch/dataprepper/plugins/source/dynamodb/stream/StreamScheduler.java#L124)
Expected behavior
Move on to the next shards and continue processing
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
- OS: [e.g. Ubuntu 20.04 LTS]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
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 ShardConsumerFactory.java at the shard-iterator error location, then trace how StreamScheduler.java handles the completed partition. Check how a missing DynamoDB source shard affects retry and completion state. Done means the pipeline moves to subsequent shards and continues processing after this error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data-engineering
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100