Comments (12)
Never mind, there must have been some kind of corruption. After flushing memcache, the problem disappeared.
from nds.
Ok, despite continuing to clear my cache, I still keep getting this warning.
from nds.
I'll create a unit test to check. I will possibly need to gob.Register(time.Time{})
on initialisation of the package. This might mean that I need to do the same with ByteString
, BlobKey
and GeoPoint
.
from nds.
How does commit 54e0d82 work? I added gob.Register
for the standard types accepted by appengine/datastore
entities.
from nds.
Thanks for the amazing response time. The warning disappeared from my logs and it successfully retrieved my data from my cache.
On a cache hit, shouldn't it only perform a single memcache operation, instead of the 4 it performed here?
from nds.
Yes, on a cache hit you should only see a memcache.Get. I don't know why there would be two gets and sets.
On the first get you should see the following as the cache is primed:
memcache Get
memcache Add
memcache Get
datastore Get
memcache Compare And Swap
The current unit tests confirm this behaviour so I'll need to try and create a test to recreate this. Are you using a PropertyLoadSaver? Are you able to tell me what piece of NDS code the memcache.Gets and memcache.Sets is referring to?
from nds.
I'm not using a PropertyLoadSaver here to eliminate the possibility of that causing the error. I'm using a simple Get on a struct with a couple time fields.
from nds.
Here are the four individual stack traces, all back to the single line in my code that calls nds.Get
.
from nds.
Thanks and nice catch. This exposes an issue/discrepancy between appengine/memcache
and appengine/datastore
. If you call appengine/datastore.GetMulti
with len(keys) == 0
then it short circuits and doesn't actually make an underlying call to the datastore service. However if I were to call appengine/memcache.Get/Set/AddMulti
with len(keys) == 0
it will still call the underlying service.
In your case, NDS is correctly fetching the cached entity in the first memcache.Get
. It then continues to execute as expected by calling the other memcache locking code with len(keys) == 0
. I know len(keys) == 0
because an underlying datastore.Get
call is not recorded on appstats.
This issue does not affect cache consistency - just efficiency. I will create a patch to ensure that nds.GetMulti
short circuits when all entities are found in cache.
from nds.
Commit 7bcaf89 should fix this issue. I'll raise the inconsistency between appengine/datastore
and appengine/memcache
with the App Engine team if you are happy with this fix.
from nds.
Awesome, you have been truly fantastic to work with. I can confirm that this commit fixes the issue. I also tested it including PropertyLoadSaver and that also worked correctly. Great job!
from nds.
Thanks your help @derekperkins with the bug reports. People really expect such a fundamental API like this to be practically bug free - and that is what I am aiming for. Thankfully none of the bugs for a long time have had anything to do with cache consistency!
from nds.
Related Issues (20)
- Remove zeroMemcache* code. HOT 1
- It is not possible to detect if nested contexts are transactional. HOT 5
- Make the transaction context safe for concurrent access. HOT 1
- Failing tests with "appengine: NewContext passed an unknown http.Request" HOT 2
- Different namespaces used for memcache and datastore HOT 4
- Migrating data when the underlying struct changes HOT 2
- Tests fail when using nds HOT 14
- nds item not stored warning HOT 4
- Calling AddMulti for a single entity instead of Add HOT 2
- Panic with datastore.PropertyLoadSaver HOT 3
- Make compatible with cloud.google.com/go HOT 8
- ErrFieldMismatch in GetMulti returns only one result HOT 4
- Gracefully handle memcache quota limits HOT 2
- Support saving of entities to memcache in putMulti() HOT 7
- Tag v2 branch as v2.0.0 HOT 3
- [v2] Possible marshal/unmarshaling bug HOT 2
- Change locking policy for Transaction HOT 1
- Change module versioning from git branches to subdirectories. HOT 2
- want new tag in v2 HOT 2
- failed to Put dial tcp 192.168.0.3:15127: connect: connection refused HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nds.