Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix "consistent" argument to boto.dynamodb2.table.Table.batch_get #2272

Merged

Conversation

cce
Copy link
Contributor

@cce cce commented May 15, 2014

It looks like the argument consistent is ignored, and instead False is passed to helper function self._batch_get, effectively enforcing eventual consistency for all reads made via boto.dynamodb2.table.Table.batch_get.

This fixes what could be a serious issue for callers expecting strongly consistent reads when setting consistent=True.

@@ -1270,7 +1270,7 @@ def batch_get(self, keys, consistent=False):
         # We pass the keys to the constructor instead, so it can maintain it's
         # own internal state as to what keys have been processed.
         results = BatchGetResultSet(keys=keys, max_batch_get=self.max_batch_get)
-        results.to_call(self._batch_get, consistent=False)
+        results.to_call(self._batch_get, consistent=consistent)
         return results

     def _batch_get(self, keys, consistent=False):

@cce cce changed the title Stop ignoring "consistent" argument to boto.dynamodb2.table.Table.batch_get Fix "consistent" argument to boto.dynamodb2.table.Table.batch_get May 20, 2014
@danielgtaylor danielgtaylor self-assigned this May 29, 2014
@danielgtaylor
Copy link
Member

This must have been a typo. Thanks for the fix.

danielgtaylor added a commit that referenced this pull request May 29, 2014
Fix "consistent" argument to boto.dynamodb2.table.Table.batch_get. Fixes #2272.
@danielgtaylor danielgtaylor merged commit c432b09 into boto:develop May 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants