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

DyanamoDB BatchWriteItem missing item writes when run in goroutines #2887

Closed
2 of 3 tasks
kartheekDogga opened this issue Nov 5, 2024 · 1 comment
Closed
2 of 3 tasks
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@kartheekDogga
Copy link

Acknowledgements

Describe the bug

I am trying to migrate some data from one dynamoDB table to another table with some item level mutation.
For this, I am reading the parent table iteratively using Scan and passing the items into a channel after modifying them.

I am writing the items into the target table using BatchWriteItems wrapped in go routines. I used a workerpool from the conc pkg to limit 5 go routines at any point of time.

The problem I am seeing is, the write succeeds but when I get the "Live Iitem Count" for the table, there are some items missing. The number of missing items is sporadic, ranging from ~100 to ~400 when the total payload size is 5000 (batched parallelly into 25 per set)

I am also checking for UnprocessedItems, which is ALWAYS empty.

Additional Details: The table is PAY_ON_DEMAND

here's the code for write operations:

``

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Live Item Count Should match total Items written in a fresh Table

Current Behavior

some Items are missing from BatchWriteItems operation with nil error and empty UnprocessedItems

Reproduction Steps

Here's a sample code
https://raw.githubusercontent.com/kartheekDogga/kartheekDogga/refs/heads/main/sample.go

steps:

  • create a test table with pay_on_demand
  • Write items into table using batchwriteitems, with added concurrency using go routines

Possible Solution

No response

Additional Information/Context

Sample code:
https://raw.githubusercontent.com/kartheekDogga/kartheekDogga/refs/heads/main/sample.go

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2 v1.32.3
github.com/aws/aws-sdk-go-v2/config v1.28.1
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.36.3

Compiler and Version used

1.22

Operating System and version

22.04.3 LTS (GNU/Linux 5.15.153.1-microsoft-standard-WSL2 x86_64)

@kartheekDogga kartheekDogga added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant