User "Krinkle" changed the status of MediaWiki.r96837. Old Status: new New Status: fixme
User "Krinkle" also posted a comment on MediaWiki.r96837. Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96837#c22832 Commit summary: RL2: Reorganize caching in LocalGadgetRepo so we no longer load the entire gadgets table from the DB on every page view. There is now one memcached entry per gadget, as well as an entry for the list of names. * Rename loadData() to loadIDs() and add loadDataFor(). These functions pull info from 1) $this->data, 2) memcached, 3) DB and propagate back up the chain when misses occur * Add getMemcKey() à la ForeignDBRepo (in phase3/includes/filerepo) and finally uncomment hasSharedCache. This means we now take advantage of cross-wiki memcached access for WMF-like configurations * Put in a dirty hack to prevent cache pollution of the names list between LocalGadgetRepo and ForeignDBGadgetRepo. Will fix this properly later. Comment: If I go to Special:Gadgets/babla (doesn't exist) on my local wiki I get this error: <pre> Fatal error: Call to a member function isEnabledByDefault() on a non-object in /Users/krinkle/Sites/mediawiki/branches/RL2/extensions/Gadgets/GadgetHooks.php on line 200 </pre> Caused by the fact that getting "all gadgets" from the repo includes the null-reponse that was cached in LocalGadgetRepo->loadDataFor() <pre> + if ( !$row ) { + // Gadget doesn't exist + // Use empty array to prevent confusion with $wgMemc->get() return values for missing keys + $data = array(); + } else { + $data = array( 'json' => $row->gd_blob, 'timestamp' => $row->gd_timestamp ); + } + // Save to object cache + $this->data[$id] = $data; + // Save to memc + $wgMemc->set( $key, $data ); + + return $data; </pre> _______________________________________________ MediaWiki-CodeReview mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview
