Chase down all code-paths that result in multiple fetches of some memcached key in the context of a single request without good reason.
Description
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Declined | None | T128543 Hunt down duplicate memcached gets | |||
| Resolved | aaron | T128125 Report duplicate key fetches | |||
| Resolved | Anomie | T127772 MWSession redis key retrieved 8-9 times per page request | |||
| Resolved | PRODUCTION ERROR | hashar | T133728 Duplicate get(): "mediawikiwiki:abusefilter:block-autopromote:xxxx" fetched 3 times | ||
| Resolved | PRODUCTION ERROR | None | T140518 Duplicate get(): "commonswiki:abusefilter:profile:…:…" fetched 2 times | ||
| Resolved | matmarex | T140522 All abuse filters run twice for every file upload | |||
| Resolved | matmarex | T140521 The UploadVerifyFile hook should say whether the upload is going to be immediately published, so consumers of UploadVerifyUpload hook can skip duplicate checks |
Event Timeline
Comment Actions
I whipped up this script to catch dupes:
Some egregious offenders, captured on mw1076:
59 times: WANCache:v:fawiki:file-djvu:dimensions:kwzejl133upgwmfx7xzaxo8makcjosi 59 times: WANCache:v:commonswiki:file-djvu:dimensions:nces1uof6ntvew3nsrr9timxjcw7bcf 57 times: WANCache:v:enwiki:revisiontext:textid:674199246 51 times: WANCache:v:enwiki:SiteStats:groupcounts:sysop 36 times: WANCache:t:eswiki:gadgets-definition:9:2 32 times: WANCache:t:commonswiki:gadgets-definition:9:2 26 times: WANCache:v:enwiki:revisiontext:textid:664533748 25 times: commonswiki:pagetranslation:sourcepages 25 times: WANCache:v:enwiki:revisiontext:textid:657411725 25 times: WANCache:v:enwiki:revisiontext:textid:607643685 24 times: WANCache:v:enwiki:revisiontext:textid:622844668 24 times: WANCache:v:enwiki:revisiontext:textid:611589557 19 times: WANCache:v:jawiki:revisiontext:textid:48538892 19 times: WANCache:v:jawiki:revisiontext:textid:42542050 17 times: WANCache:v:itwikisource:file-djvu:dimensions:q2lvtjhv5om2d9lnawvfbwqpkrbrhx1 17 times: WANCache:v:frwikisource:file-djvu:dimensions:0teduf9evyos2mqtghzco1v63oqxhj9 16 times: WANCache:t:enwiki:gadgets-definition:9:2
Comment Actions
I would strongly urge us to stay away from fix-it-all solutions that just process-cache entire BagOStuffs. Code really shouldn't be spreading its lookups in the first place. Such caching complicates things a lot. I've seen this happen in other applications and it never ends well.
On the other hand, re-using values as actual data via descriptive methods that lazy-load value in-object is sweet. And static caches for entire objects is great too (such as for Title).
I'd rather we invest a little extra discipline in centralising lookup responsibility where not the case currently and add more functional caching. (lazy-load data and cache entire class objects)