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

Emulator doesn't differentiate between MORE_RESULTS_AFTER_LIMIT and NO_MORE_RESULTS #130

Open
pcostell opened this issue Jul 25, 2016 · 4 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. external This issue is blocked on a bug with the actual product. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@pcostell
Copy link
Contributor

This is a result of the emulator being built
on the Cloud Datastore API for App Engine, which only distinguishes between
NOT_FINISHED or not. Since the more_results flag is a hint (see below),
the only safe response when the query is finished is
MORE_RESULTS_AFTER_LIMIT.

Something to note:

more_results is a best effort hint to the developer. In the case of the
emulator it is buggy that MORE_RESULTS_AFTER_LIMIT is returned even if
the query didn't reach the limit. However even in production, the query may
return MORE_RESULTS_AFTER_LIMIT even if there are no more results if the
server is unwilling to do the work to check for the next entity.

This is not the issue here but for posterity: in order to determine if you
should keep iterating through results the clients should only ever use
more_results == NOT_FINISHED aa loop condition.

@stephenplusplus
Copy link

@pcostell is this still an issue? We had another question about this pop up in googleapis/google-cloud-node#2846

@jskeet
Copy link

jskeet commented Apr 3, 2019

I've just found this issue by running my .NET integration tests against the emulator. So yes, it looks like it's still an issue.

jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Apr 3, 2019
jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Apr 17, 2019
jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Apr 17, 2019
jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Apr 17, 2019
jskeet added a commit to googleapis/google-cloud-dotnet that referenced this issue Apr 17, 2019
chrisrossi pushed a commit to chrisrossi/python-ndb that referenced this issue Jun 24, 2019
Improve usage of Datastore Emulator by not requiring credentials to be
set.

Rewrite failing system test to work around emulator discrepency with
``more_results`` field of ``QueryResultsBatch`` message.

See: googleapis/google-cloud-datastore#130

Update the ``more`` return value of ``Query.fetch_page`` to be ``False``
if an empty page has just been retrieved. This is intended to prevent
possible infinite loops in client code when using the Datastore
emulator.
chrisrossi pushed a commit to googleapis/python-ndb that referenced this issue Jun 24, 2019
Improve usage of Datastore Emulator by not requiring credentials to be
set.

Rewrite failing system test to work around emulator discrepency with
``more_results`` field of ``QueryResultsBatch`` message.

See: googleapis/google-cloud-datastore#130

Update the ``more`` return value of ``Query.fetch_page`` to be ``False``
if an empty page has just been retrieved. This is intended to prevent
possible infinite loops in client code when using the Datastore
emulator.
@elharo elharo added the bug label Nov 11, 2019
@kolea2 kolea2 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. external This issue is blocked on a bug with the actual product. labels Apr 7, 2021
sveneberth added a commit to sveneberth/viur-core that referenced this issue May 14, 2021
sveneberth added a commit to sveneberth/viur-core that referenced this issue May 14, 2021
@meredithslota meredithslota added the api: datastore Issues related to the Datastore API. label Nov 24, 2021
@meredithslota
Copy link

@pcostell It seems like this issue persists; can we route this internally to the emulator team?

@meredithslota
Copy link

I created internal issue b/259553638 and have routed it to the Datastore Emulator team. Thanks!

@meredithslota meredithslota added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Nov 17, 2022
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 Datastore API. external This issue is blocked on a bug with the actual product. priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

6 participants