Repository navigation
Resolve shard hash key range from the lease via ShardInfo instead of ListShards - #1828
Merged
Merged
Conversation
chenylee-aws
requested a deployment
to
manual-approval
October 15, 2026 00:36 — with
GitHub Actions
Waiting
chenylee-aws
force-pushed
the
hashkey-shardinfo
branch
from
October 15, 2026 06:00
b5e44c2 to
a79dd74
Compare
chenylee-aws
requested a deployment
to
manual-approval
October 15, 2026 06:00 — with
GitHub Actions
Waiting
…of delivered unfiltered
chenylee-aws
requested a deployment
to
manual-approval
October 15, 2026 16:59 — with
GitHub Actions
Waiting
chenylee-aws
requested a deployment
to
manual-approval
October 16, 2026 01:40 — with
GitHub Actions
Waiting
chenylee-aws
force-pushed
the
hashkey-shardinfo
branch
from
October 19, 2026 17:13
95a9b21 to
204fe3f
Compare
chenylee-aws
requested a deployment
to
manual-approval
October 19, 2026 17:13 — with
GitHub Actions
Waiting
lucienlu-aws
approved these changes
Oct 19, 2026
vincentvilo-aws
pushed a commit
to vincentvilo-aws/amazon-kinesis-client
that referenced
this pull request
Oct 26, 2026
chenylee-aws
added a commit
to chenylee-aws/amazon-kinesis-client
that referenced
this pull request
Oct 26, 2026
chenylee-aws
added a commit
that referenced
this pull request
Oct 26, 2026
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
With the default
skipShardSyncAtWorkerInitializationIfLeasesExist=false,ProcessTaskcalledshardDetector.shard()on every batch to get the shard's hash key range for KPL de-duplication. On a cold or stale shard cache (worker start, reshard, lease takeover) that callsListShardson the data path, where a failure used to drop the batch.KCL stores the hash key range on every lease since 2.3, so this change takes it from the lease instead:
DynamoDBLeaseCoordinator.convertLeaseToAssignmentcopies the lease's range into a new optionalShardInfofield (new constructor overload; existing constructors unchanged; excluded fromequals/hashCode/toString).ShardConsumerArgument.hashKeyRange()reads it fromShardInfoand caches it per consumer, falling back to theShardDetectoronly for legacy leases or custom coordinators that don't set it. AShardDetectorfailure propagates, so the batch is retried by the dispatch retry from Retry records delivery in shardConsumer #1822 instead of being delivered without range filtering.ProcessTasktakes the resolved range instead of aShardDetector.No behavior change for
skip=true(still no range filtering). Additive API only.Testing:
ConsumerStatesTest,ShardInfoTest,DynamoDBLeaseCoordinatorTest,ProcessTaskTest;mvn clean installpasses.TaskExecutionListenerrecordedShardInfo.hashKeyRange()per process task and an SDK interceptor classified everyListShardscaller:ShardInforangeListShardsskip=falseskip=trueskip=falseProcessTask.<init>)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.