opensearch-project / opensearch-project/data-prepper
Use ShardFilter to reduce calls on DescribeStream
@dlvenable is already working on this.
Since Aug 4, 2026.
- Dominant language
- Java
- Stars
- 374
- Forks
- 354
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
The dynamodb source must discover new shards. It currently does this every 1 minute (though this is now configurable per #7000).
The LeaderScheduler runs a loop running on the lease interval. It calls DescribeStream to get all the shards.
There are two problems with this approach:
- This leads to latency spikes. When a
ShardConsumerreaches the end of a shard its children are not discovered until the next discovery cycle. When this happens, there can be a pause in ingestion. - Using the
DescribeStreamto list all shards can be inefficient and lead to throttling.
Problem 1 can be partially mitigated by #7000 which will reduce the latency. But the latency still exists - it is just shortened. And using this can possibly exacerbate problem 2 by calling DescribeStream too often.
Describe the solution you'd like
DynamoDB's DescribeStream provides a ShardFilter.
We can change the design such that when a shard consumer reaches the end of a shard, it calls DescribeStream filtering by the shard's ID to fetch child shards. When it discovers these it can create the stream partitions immediately. This would give us child shards immediately rather than waiting for the full-stream DescribeStream.
If for some reason the ShardFilter call doesn't include a child shard (this can happen rarely), then the periodic discovery would still run and pick it up.
Describe alternatives you've considered (Optional)
We can rely on lowering the leasing interval as given in #7000. But we risk throttling.
Additional context
The DynamoDBStreamsDataFetcher takes a similar approach:
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.
Assessment
This issue has not been assessed yet.