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

fix: do not set read_consistency for queries #664

Merged
merged 1 commit into from
Jun 4, 2021

Conversation

sorced-jim
Copy link
Contributor

@sorced-jim sorced-jim commented May 28, 2021

In Cloud Datastore ancestor queries are intended to be strong by default
(https://cloud.google.com/datastore/docs/concepts/structuring_for_strong_consistency) .

In Cloud Firestore in Datastore mode, all queries should be strongly
consistent by default (https://cloud.google.com/datastore/docs/upgrade-to-firestore).

closes #666

In Cloud Datastore ancestor queries are intended to be strong by default
(https://cloud.google.com/datastore/docs/concepts/structuring_for_strong_consistency) .

In Cloud Firestore in Datastore mode, all queries should be strongly
consistent by default (https://cloud.google.com/datastore/docs/upgrade-to-firestore).
@sorced-jim sorced-jim requested a review from andrewsg as a code owner May 28, 2021 01:19
@sorced-jim sorced-jim requested a review from a team May 28, 2021 01:19
@sorced-jim sorced-jim requested a review from a team as a code owner May 28, 2021 01:19
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label May 28, 2021
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/python-ndb API. label May 28, 2021
@chrisrossi
Copy link
Contributor

Hi @sorced-jim ,

Can you help me understand the problem being solved here? If you wanted to open an issue explaining a bug in NDB and marking this PR as fixing that issue, that would be helpful.

Thank you!

@sorced-jim
Copy link
Contributor Author

Chris, the problem being solved is that NDB is incorrectly setting the default query consistency as noted from the documented links. In general Cloud Datastore or Cloud Firestore libraries should avoid duplicating service default (what is attempted currently with the code).
n
I'll go back to my examples, Cloud Datastore, & ndb users should expect that ancestor queries are strongly consistent, with the current version of Cloud NDB this is not true because the default read consistency is set instead of doing what other client libraries do and let the service select the default consistency.

For Cloud Firestore in Datastore mode, all queries should be strongly consistency until the user explicitly requests an eventually consistent request. With the current version of Cloud NDB this is not true because the default read consistency is set instead of doing what other client libraries do and let the service select the default.

@craiglabenz craiglabenz changed the title Do not set read_consistency for queries. fix: do not set read_consistency for queries. Jun 3, 2021
Copy link

@craiglabenz craiglabenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@craiglabenz craiglabenz added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 3, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 3, 2021
@craiglabenz craiglabenz changed the title fix: do not set read_consistency for queries. fix: do not set read_consistency for queries Jun 3, 2021
@craiglabenz craiglabenz added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 3, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 3, 2021
@chrisrossi chrisrossi added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 4, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 4, 2021
@chrisrossi chrisrossi merged commit 36a5b55 into googleapis:master Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/python-ndb API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloud NDB - Delayed result or index with Firestore in Datastore mode
4 participants