Search code examples
google-app-enginegoogle-cloud-datastoreapp-engine-ndb

GAE console updates not applying to deployed app (not eventual consistency)


My app is GAE standard.

I can edit an entity in the cloud console from a URL that starts with this:

https://console.cloud.google.com/datastore/entities/query

I'll save the entity and refresh the page and the new data is shown.

On my website, I then go to a page that retrieves the entity using the entity ID like this

e = Entity.get_by_id(1234)

But my website shows the old data! It seems like this shouldn't be possible.

My only solution is to then use remote api shell to get the entity (which shows the old data) and then update and then put the entity. My website then shows the new data.

How is it possible that updating an entity in the cloud console doesn't show up in production when getting an entity by its id?


Solution

  • This sounds like a caching problem - as the warning at the top of this page notes, updating entities via the datastore console doesn't update or flush the cache. You should try flushing the memcache via the console after you make an update, which will ensure that the query hits the datastore directly.