PynamoDB's get() method occasionally returns stale/incorrect data when multiple queue messages are processed simultaneously, leading to data consistency issues.
Context: Worker processes consuming from a queue, with multiple messages published within the same second
Problem:
The DynamoDB query
CommitTask.get(hash_key=event.commit_id, range_key=event.task_id)
sometimes returns a record where commit_task.task_id doesn't match the expected event.task_id
Inconsistency: Retrying the same get() operation immediately after returns the correct/expected result
Trigger: Issue occurs specifically when queue payloads are published simultaneously (within the same second)
i try to use consistent_read = True but i don't think it's the case here.
any idea where is the problem?