awslabs / amazon-dynamodb-local-samples

This is a sample Java project that demonstrates how to use DynamoDB Local for local development and testing
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
MIT No Attribution
14 stars 8 forks source link

DynamoDBLocal ReturnConsumedCapacity incorrect for BatchGet and BatchWrite #7

Open switch180 opened 10 months ago

switch180 commented 10 months ago

Redirecting a bug report on behalf of @drshriveer , who informed the DynamoDB SSA team in this issue about a bug:

Hi, apologies for filing an issue here, but I [@drshriveer] have found no other place to file this bug that makes sense. I'm hoping someone on the AWS team can direct this bug to the right place or otherwise let me know where that place is.

Issue:

I have found two instances where DynamoDBLocal fails to return the correct/expected Consumed Capacity. Both when using BatchAPIs against records that do not exist.

  1. When attempting to delete a single record that does not exist via the BatchWrite API, DDBLocal returns 2.0 consumed capacity units. This should be 1.0, as verified against production DynamoDB as well as using the DeleteItem (non-batch) API.

  2. When attempting to Get a single record that does not exist via the BatchGet API, DDBLocal returns 0.0 consumed capacity units. This should be 0.5 (eventually consistent reads) or 1.0 (strongly consistent reads). Again, I verified this against production DynamoDB and tested DDBLocal via the GetItem API which behaves as expected.

shetsa-amzn commented 9 months ago

We appreciate your feedback and we are currently reviewing this. We will update as soon as we have more information about next steps.