kinesis-producer icon indicating copy to clipboard operation
kinesis-producer copied to clipboard

Retain user record partition keys

Open jawang35 opened this issue 5 years ago • 1 comments

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: https://github.com/awslabs/kinesis-aggregation/issues/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 avatar Aug 26 '19 20:08 jawang35

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

jawang35 avatar Nov 25 '19 23:11 jawang35