Datastore Emulator still enforces ancestor queries in transactions

266 views
Skip to first unread message

Kieran McHugh

unread,
Oct 24, 2020, 10:54:35 AM10/24/20
to Google Cloud Datastore
Hi everyone,

We've noticed quite a big discrepancy between the behaviour of the Datastore emulator and the real Firestore in Datastore mode. Specifically the emulator will throw an error if you try to do a non-ancestor query inside a transaction.
Error: 3 INVALID_ARGUMENT: Only ancestor queries are allowed inside transactions.

My understanding is that the "real" Firestore in Datastore Mode no longer imposes this restriction. The impact is that we're not able to use the emulator locally for development as our code relies on non-ancestor queries.

I've tried setting the "consistency" flag to 1.0, but that doesn't seem to help.

Is there a workaround for this issue or any possible timeline on updating the behaviour?

Apologies if I'm missing something here!

Thanks a lot
Kieran

Kieran McHugh

unread,
Jan 4, 2021, 6:41:00 PM1/4/21
to Google Cloud Datastore
Would anybody from Google please be able to help with this? Thank you

Jean Pagán

unread,
Jun 18, 2021, 10:56:24 PM6/18/21
to Google Cloud Datastore
I came here looking into this also. The Cloud Datastore emulator is still enforcing the limits of the regular Datastore inside of a transaction even if you are using Firestore in Datastore mode in the cloud app. As I understand, every Cloud Datastore database was to be upgraded to Firestore in Datastore Mode as stated in https://cloud.google.com/datastore/docs/upgrade-to-firestore, so there should at least be an option to set it to use the Firestore in Datastore Mode logic.

An official response on this issue would be nice.

Volker Braun

unread,
Jul 15, 2021, 12:21:09 PM7/15/21
to Google Cloud Datastore
Datastore migration is apparently underway, but at least we haven't been updated yet (also no email and no MigrationStateEvent logged). The website you linked currently says:

"As of June 2021, migrations from Cloud Datastore to Firestore in Datastore mode have started. The migrations are starting from very low traffic databases and will expand to higher traffic databases over the coming months."

Volker Braun

unread,
Jul 15, 2021, 12:24:31 PM7/15/21
to Google Cloud Datastore
PS: you might want to star this issue in the bug tracker to indicate your interest: https://issuetracker.google.com/issues/178391031

Jean Pagán

unread,
Jul 15, 2021, 5:08:15 PM7/15/21
to Google Cloud Datastore
I just starred it. Thanks!

Kieran McHugh

unread,
Jul 19, 2021, 6:39:34 AM7/19/21
to Google Cloud Datastore
Thanks for sharing the link to the bug tracker!

We are already on Firestore in Datastore Mode and this issue impacts us. The emulator hasn't been updated to reflect the new post-migration behaviour.
Reply all
Reply to author
Forward
0 new messages