Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain user record partition keys #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

jawang35
Copy link

@jawang35 jawang35 commented Aug 26, 2019

With shard mapping and the KPL architecture not implemented, user records are potentially already being aggregated to the wrong shards. However, it would still be nice to retain the original user records' partition keys so that on the consumer side we could expect the documented aggregation format.

I also fixed a bug where we were miscalculating the record size. In edge cases that are easier to reproduce with small user records, I was seeing the following error:

com.amazonaws.services.kinesis.model.AmazonKinesisException: 1 validation error detected: 
Value 'java.nio.HeapByteBuffer[pos=0 lim=1048954 cap=1048954]' at 'data' failed to satisfy 
constraint: Member must have length less than or equal to 1048576 (Service: AmazonKinesis; Status 
Code: 400; Error Code: ValidationException; Request ID: f114615a-9256-5a12-a33c-39f52eb5e9c3)

Following the discussion on this issue: awslabs/kinesis-aggregation#30 I found that we aren't taking into account the size of the protobuf wire type. See Node.js aggregation library for example: https://github.com/awslabs/kinesis-aggregation/blob/master/node/lib/kpl-agg.js#L60.

jawang35 and others added 3 commits August 21, 2019 21:30
* Fix max record size check

* Add message index and wire type to protobuf message size

* Revert >= change
@jawang35
Copy link
Author

@a8m any chance this will be reviewed? Even if the partition keys change is not approved I think the bug fix is valuable.

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.

1 participant