Description
Acknowledgements
- I have searched (https://github.com/aws/aws-sdk/issues?q=is%3Aissue) for past instances of this issue
- I have verified all of my SDK modules are up-to-date (you can perform a bulk update with
go get -u github.com/aws/aws-sdk-go-v2/...
)
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)