opensearch-project / opensearch-project/data-prepper

Use ShardFilter to reduce calls on DescribeStream

Open
#7,041 0 comments 0 reactions 1 assignee View on GitHub

@dlvenable is already working on this.

Since Aug 4, 2026.

enhancement
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:

  1. This leads to latency spikes. When a ShardConsumer reaches 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.
  2. Using the DescribeStream to 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:

https://github.com/awslabs/dynamodb-streams-kinesis-adapter/blob/master/src/main/java/com/amazonaws/services/dynamodbv2/streamsadapter/DynamoDBStreamsDataFetcher.java#L367

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.