Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
💡 Codex Reviewvector/src/sources/aws_kinesis_streams/closed_shard.rs Lines 165 to 168 in 55eb597 An empty vector/src/sources/aws_kinesis_streams/source.rs Lines 1154 to 1156 in 55eb597 With acknowledgements enabled, the final vector/src/sources/aws_kinesis_streams/batcher.rs Lines 48 to 53 in 55eb597 When multiple batches are in flight, their downstream acknowledgements can complete out of order, but this immediately advances the checkpoint to whichever acknowledged sequence compares greatest. If a later batch is delivered while an earlier batch is still pending or rejected, the periodic DynamoDB checkpoint moves past the gap; a restart then begins after the later sequence and loses the earlier records. The tracker needs to retain batch order and advance only after every preceding batch has been delivered. vector/src/sources/aws_kinesis_streams/source.rs Lines 883 to 890 in 55eb597 Any documented vector/src/sources/aws_kinesis_streams/closed_shard.rs Lines 165 to 168 in 55eb597 An empty vector/src/sources/aws_kinesis_streams/source.rs Lines 1154 to 1156 in 55eb597 When the final vector/src/sources/aws_kinesis_streams/batcher.rs Lines 48 to 52 in 55eb597 With acknowledgements enabled, receivers for multiple Kinesis batches run concurrently, so a later batch can be delivered before an earlier batch is delivered or rejected. This implementation immediately advances to the greatest reported sequence without tracking gaps; the next periodic checkpoint can therefore move past undelivered records, which are lost after a restart or lease transfer. vector/src/sources/aws_kinesis_streams/source.rs Lines 887 to 890 in 55eb597 If vector/src/sources/aws_kinesis_streams/closed_shard.rs Lines 72 to 74 in 55eb597 On a fresh deployment or after recreating the checkpoint table, any shard that was closed by an earlier split or merge has no checkpoint and is discarded here. With the default vector/src/sources/aws_kinesis_streams/closed_shard.rs Lines 183 to 189 in 55eb597 For a closed shard, every vector/src/sources/aws_kinesis_streams/source.rs Lines 701 to 704 in 55eb597 After an explicit-shard consumer crashes, its DynamoDB row retains vector/src/sources/aws_kinesis_streams/checkpointer.rs Lines 512 to 517 in 55eb597 When a consumer discovers that its conditional checkpoint failed because another client stole the lease, it calls this method against a row already owned by that new client. The unconditional update can overwrite the new owner's newer sequence—or even replace its vector/src/sources/aws_kinesis_streams/closed_shard.rs Lines 72 to 74 in 55eb597 When a source starts against an existing resharded stream with an empty or newly created checkpoint table, retained closed parent shards do not yet have checkpoint rows. Skipping them here loses all records still retained in those parents even with the default vector/src/sources/aws_kinesis_streams/closed_shard.rs Lines 183 to 189 in 55eb597 For a closed shard, every vector/src/sources/aws_kinesis_streams/source.rs Lines 701 to 705 in 55eb597 Explicit mode always calls vector/src/sources/aws_kinesis_streams/checkpointer.rs Lines 512 to 517 in 55eb597 When a consumer learns that another client has stolen its lease, vector/src/sources/aws_kinesis_streams/source.rs Lines 712 to 714 in 55eb597 Every explicit shard is launched with vector/src/sources/aws_kinesis_streams/source.rs Lines 1201 to 1204 in 55eb597 The declared output schema includes standard Vector source metadata, but decoded logs only receive ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Summary
This PR adds a new
aws_kinesis_streamssource. Vector can now read logs from AWS KinesisData Streams.
The source stores progress in DynamoDB. Several Vector processes can share the same stream
and split shards between them.
Closed shards follow KCL 3.0 rules:
SHARD_ENDcheckpoint. Vector does not keep pollingit until data expires.
SHARD_END(or has no lease).TRIM_HORIZON, notLATEST.GetRecordsresult on a closed shard stops that consumer.ListShardsno longer returns are deleted.This stops CloudWatch
GetRecords.IteratorAgeMillisecondsfrom growing for a long timeafter a reshard.
Kinesis and DynamoDB errors now use the AWS SDK
DisplayErrorContexthelper. Logs showthe full error chain, not only a short label like
service error.Changelog files:
changelog.d/aws_kinesis_streams_closed_shard_iterator.fix.mdchangelog.d/aws_kinesis_streams_sdk_error_context.enhancement.mdReferences
Vector configuration