Closed Bug 781993 Opened 12 years ago Closed 10 years ago

Sanity-check maximum key and value lengths in memcache backend

Categories

(Cloud Services Graveyard :: Server: Sync, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: rfkelly, Assigned: rfkelly)

Details

(Whiteboard: [qa+])

Memcache imposes maximum key length and maximum data size limits, and I'm pretty sure couchbase as similar limits.  We should have some sanity-checking in the memcache backend to be sure we don't go over them, or at least to ensure that things break safely if we do.  :rfkelly to audit this in current setup.

I am hoping that the underlying memcache client library would report this as an error rather than, say, silently truncating any data...
:atoll reports that couchbase sets the following limits:

Max key length: 250 bytes
Max value size: 20 Mbytes
Quick test:  pylibmc handles this properly, umemcache passes through the underlying server errors and then gets confused about the state of the connection.  So we need to add an extra level of sanity-checking on top of umemcache.
Whiteboard: [qa+]
This will need to happen inside mozsvc for sync2.0:

  https://github.com/mozilla-services/mozservices/pull/26
FWIW ultramecache had a hardcoded 1MB limit for the item size, and I made it configurable a while ago at https://github.com/esnme/ultramemcache/commit/1ac1a0e02c78710fa99899d86481cb8a02e986a9

You should get a 'clean' error with that backend at least for the value.
old pr is old, but landed in mozsvc
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Quick verification in code.
Status: RESOLVED → VERIFIED
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.