Comments (12)
This doesn't sound like a nds specific error. NDS usually emits errors nds: [error type]
. Is it consistent or intermittent? In any case, nds is designed to work fine with any type of memcache error or even if the memcache backend completely goes down.
The one caveat is that nds.Delete
needs to ensure that memcache.Delete
completes successfully before it works so that it can guarantee strong cache consistency.
Please let me know if you find out any more information. I'll leave this issue open a bit longer. My instances haven't logged this error today but I'll keep looking.
from nds.
Sorry, the dev who passed on the log didn't give me the whole thing. This is what was getting thrown.
nds:lockMemcache AddMulti memcache: server error
It was happening on every datastore request, and I haven't seen anything specific that is different that might have caused it. Is there maybe a difference in max record sizes between memcache and datastore?
from nds.
Looks like this may be tied to having special characters in the key. I tried 3 specifically: ?
, =
, %
. All 3 cause the memcache: server error
to be thrown. I took those out, it worked just fine.
from nds.
@josephbergevin that's interesting to know, however I don't think this is an issue affecting NDS. The memcache keys will never use those characters. datastore.Key.Encode()
uses base 64 encoding and removes the trailing "=". This is identical to what Python's ndb does.
@derekperkins are you still seeing these problems consistently? Could it have been that the API was down at the time?
from nds.
@jongillham I actually work in the same room as @josephbergevin, so yes, I'm seeing the same error. :) I think Joe narrowed the problem down to the length of the StringID
.
from nds.
I investigated further and it seems the error may be tied to a character limit on the StringID
. 147 chars is the max limit I could use in a key. If I go over that, I get these errors/warnings:
GetMulti
gives a warning: nds:lockMemcache AddMulti memcache: server error
PutMulti
throws an error: memcache: server error
from nds.
@josephbergevin awesome deductive work! I see the Python and Go SDK functionality differs here. The max key size on both platforms is 250 bytes. However Python automatically hashes the key if it is longer than 250 bytes and Go just raises an error.
This error must be what you are seeing. I'll investigate what type of hashing Python does and then copy it. I suppose there will be risk of hash collision but it must be small enough for the guys that made the Python SDK to not worry about.
What do you think?
from nds.
Just for reference here's what Python's API does.
MAX_KEY_SIZE = 250
if len(server_key) > MAX_KEY_SIZE:
server_key = hashlib.sha1(server_key).hexdigest()
I wonder if it is worth using sha256 or sha512 to reduce the possibility of collisions...
http://stackoverflow.com/questions/1867191/probability-of-sha1-collisions
Probably not.
from nds.
Yeah, probably not. For it to be an issue, all of these would have to be the case:
- The 2
StringID
s would have to hash to the same key - Both of the total keys have to exceed 250 characters
- Both would have to be called in close enough proximity that neither one has been evicted from memcache already.
If it were more persistent data, it might be more of an issue, but I don't forsee this being that big of an problem.
from nds.
Yes, I agree with @derekperkins. That sounds great.
from nds.
Commit 924699e should hopefully fix this issue. I'll await feedback before I close this as the dev environment does not replicate this issue.
from nds.
That worked! I think you can go ahead and close the issue. Thanks for the quick responses!
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.