Closed Bug 745059 Opened 13 years ago Closed 13 years ago

memcached backend fails to increment total size

Categories

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

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: rfkelly, Unassigned)

References

Details

(Whiteboard: [qa+])

Attachments

(1 file)

The MemcachedSQLStorage backend fails to increment the cached "total size" measurement when the user uploads an item, due to a quirk of memcached/pylibmc. The "user_id:size" is currently stored into memcached as a float. When storing a new item, the MemcachedSQLStorage backend uses the "incr" command to increase this by the size of the new item. Unfortunately, "incr" silently fails to work on floats and the size does not get updated. Attached patch fixes the problem by explicitly coercing to an integer. This could well explain the strange behaviour witnessed in Bug 687108. There is a small value stored in memcache from an earlier quota viewing, and it is not updated as the user syncs lots and lots of stuff. This leads to a growing discrepancy between the information in /info/quota (which is calculated from memcached) and /info/collection_usage (which is calculated from the database). The eventual call to /info/collection_usage forces an update of the cached data and results in subsequent /info/quota calls returning the correct(ish) value.
Attachment #614653 - Flags: review?(telliott)
Blocks: 740695
Comment on attachment 614653 [details] [diff] [review] patch to correctly increment storage size in memcached This sort of thing is not endearing me to python :P
Attachment #614653 - Flags: review?(telliott) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
This is no longer happening. Tested on qa1.
Status: RESOLVED → VERIFIED
Whiteboard: [qa-] → [qa+]
And, again, Verified as fixed with 4/16 make build and make test.
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: