Skip to content

Kinesis: honor ExclusiveStartShardId in DescribeStream - #10568

Open
gedaliakliger wants to merge 1 commit into
getmoto:masterfrom
gedaliakliger:fix/10567-kinesis-describe-stream-exclusive-start-shard-id
Open

gedaliakliger wants to merge 1 commit into
getmoto:masterfrom
gedaliakliger:fix/10567-kinesis-describe-stream-exclusive-start-shard-id

Conversation

@gedaliakliger

Copy link
Copy Markdown

Fixes #10567

DescribeStream applied Limit and set HasMoreShards, but ignored ExclusiveStartShardId, so each follow-up call returned the first page again, and botocore's describe_stream paginator raised PaginationError whenever PageSize was below the shard count.

describe_stream now passes ExclusiveStartShardId to Stream.to_json, which starts after that shard ID (IDs are zero-padded, so string order is ID order) and computes HasMoreShards from the shards left after it. Calls without the parameter return what they did before.

test_describe_stream_exclusive_start_shard_id pages a five-shard stream by hand (shards 2 and 3 with HasMoreShards true, then shard 4 with it false) and through the paginator with PageSize=2 (all five shards once, in order). It fails on master and passes with the fix.

Ran here: tests/test_kinesis/ (89 passed, Docker tests skipped), the new test and test_describe_stream_limit_parameter in server mode, and ruff format, ruff check and mypy on the changed files. The full suites are left to CI.

AWS reference: https://docs.aws.amazon.com/kinesis/latest/APIReference/API_DescribeStream.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kinesis: DescribeStream ignores ExclusiveStartShardId

1 participant