We experienced some stale Datastore data in our Python Google AppEngine application. I inspected the log and saw the following warning in the requests that were supposed to update the respective data:
Memcache set_multi() error: [':part', ':full']
The log entry was produced after an ndb.put(). There were no exceptions raised, only this silent log output. However, the model was not written to the Datastore. This happened repeatedly for 4 times.
To be accurate, I am not 100% sure if the log was produced during the put() of my model or afterwards, while GAE is saving appstats for that particular request. In addition, this log says that our memcache is full, I don't clearly get it as a problem (caches are expected to get full from time to time, right?).
Yet, in all cases that this log was produced, the put() did not write data to the Datastore and I cannot identify why this happened. If the ndb.put() failed, I would expect some kind or error/exception raised (my code handles these), but the warning was silent.
Any suggestions?
You can turn off memcache in the NDB Context class. This SO answer shows how to enable/disable memcache: ndb Models are not saved in memcache when using MapReduce
This code disables all caching:
ndb_ctx = ndb.get_context()
ndb_ctx.set_cache_policy(lambda key: False)
ndb_ctx.set_memcache_policy(lambda key: False)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With