Commit graph

23 commits

Author SHA1 Message Date
Aaron
676446ef90 Made default BagOStuff::incr() function more like memcached.
Change-Id: Ia216f20fdcf855448e2f2e4d99667e72c6254f82
2012-09-05 11:51:04 -07:00
Vitaliy Filippov
359d2fd2f9 Bug 20595 - Fixed incr()/decr() functions for some caches.
* Preserve TTL in objectcache incr() method for APC, XCache and DBA.
  Do not serialize numeric values, since it breaks the counters.
* Also gave some DBABagOStuff functions explicit visibility.

Change-Id: I13856832f418c843afc8e42a6d77686331f6cb41
2012-08-29 18:35:24 -07:00
Tim Starling
5800c37533 Added a Redis client for object cache storage
With sharding, failover and consistent hashing. Only supports the
extension (phpredis), since the pure PHP library Predis had about a
billion files and it made my eyes hurt.

Change-Id: I90fb4a41d15265b9c22f8e32ecd1d956f89f3ce8
2012-08-09 10:01:34 +10:00
Reedy
019e74a31a Flesh out parameter documentation etc
Remove some trailing whitespace

A bit of code simplification

Change-Id: Iea96a2482c53868713a43569be4e5de4c9edb2a2
2012-07-09 12:44:13 +00:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Aaron Schulz
3c1495e968 Made default BagOStuff functions work consistently.
* Made getMulti() only return keys for items that exists.
* Made add() return false if the item already exist.
* Made replace() return false it the item does not already exist.

Change-Id: Idb9d9843ace0c81f71abfc22b90e30eb33d7579d
2012-06-03 16:29:39 -07:00
Aaron Schulz
6a460ed446 Renamed new BagOStuff getBatch() function to getMulti() for consistency.
Change-Id: Icfe673919f65192565aa114c165c90d97d33785a
2012-05-15 01:48:22 -07:00
Tim Starling
d3fd5db207 Minor PECL client fixes
* Fixed the check for igbinary presence. It's not enough for the
  extension to be loaded, the memcached extension also needs to be
  compiled with --enable-memcached-igbinary.
* When delete() is attempted on a key that doesn't exist, return true,
  as in the other BagOStuff implementations.

Change-Id: I298952f4a9925d860fa5673f632d073b1f20aa47
2012-05-15 14:13:58 +10:00
Aaron
a763553077 Improved BagOStuff documentation and made some return value tweaks.
Change-Id: I9d8f09c10ccc5e710bd8cae05b8f3da3c2d02056
2012-04-26 18:34:32 -07:00
Aaron Schulz
8019ebda16 Added getBatch() function to BagOStuff and optimized it for memcached.
Change-Id: Id8a3ed1ac7b22db7f7bf58ffde4be3285e8e2df9
2012-04-21 11:07:18 -07:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Sam Reed
f3cc77aaee Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:41:50 +00:00
Tim Starling
53d267b3dc purgeParserCache.php improvements:
* Do queries in batches of 100 rows instead of all at once. Note that if there are a lot of objects with the exact same expiry time, it might take multiple runs of the script to delete them all.
* Progress meter.
2011-12-02 02:59:11 +00:00
Mark A. Hershberger
58a53f643e feed the OCD: eol w/s 2011-11-01 18:31:38 +00:00
Tim Starling
cac02778e4 * Added a script to reduce disk space on a MySQL parser cache setup such as the one at Wikimedia at the moment, by removing all objects which expire before a given time.
* Fixed unintentional shortcut evaluation in MultiWriteBagOStuff::doWrite(). It would have caused writes to be skipped on the second cache if the first cache failed, now writes should be attempted on all caches.
2011-09-09 03:51:45 +00:00
Sam Reed
ba0cbdeeff More parameter documentation!! 2011-05-28 15:59:57 +00:00
Sam Reed
e514478ba5 Fix function level comments that start with /* not /** 2011-05-21 19:35:16 +00:00
Chad Horohoe
8ae2840afb Make this private since nothing outside here calls it 2011-04-29 22:40:31 +00:00
Chad Horohoe
10a2ec8072 Tweak debug() to use name of class in debug output 2011-03-03 12:52:30 +00:00
Tim Starling
be76d86932 * Rewrote ObjectCache.php to conform to the modern coding style, and to be less convoluted about how CACHE_ANYTHING and CACHE_ACCEL are resolved. Moved most functionality to static members of a new ObjectCache class.
* Moved the global functions to GlobalFunctions.php, where they are now just convenience wrappers. Made them return non-references. Updated callers (none found in extensions). 
* Added an advanced configuration method, $wgObjectCaches, which allows a lot more detail in the object cache configuration than $wgMainCacheType. 
* Made all object cache classes derive from BagOStuff. 
* Split the MWMemcached class into a generic client class and a MediaWiki-specific wrapper class. The wrapper class presents a simple BagOStuff interface to calling code, hiding memcached client internals, and will simplify the task of supporting the PECL extension.
* Added some extra constructor parameters to MWMemcached, configurable via $wgObjectCaches.
* Removed the *_multi() methods from BagOStuff, my grepping indicates that they are not used.
* Rewrote FakeMemCachedClient as a BagOStuff subclass, called EmptyBagOStuff.
* Added an optional "server" parameter to SQLBagOStuff. This allows the server holding the objectcache table to be different from the server holding the core DB.
* Added MultiWriteBagOStuff: a cache class which writes to multiple locations, and reads from them in a defined fallback sequence. This can be used to extend the cache space by adding disk-backed storage to existing in-memory caches.
* Made MWMemcached::get() return false on failure instead of null, to match the BagOStuff documentation and the other BagOStuff subclasses. Anything that was relying on it returning null would have already been broken with SqlBagOStuff.
* Fixed a bug in the memcached client causing keys with spaces or line breaks in them to break the memcached protocol, injecting arbitrary commands or parameters. Since the PECL client apparently also has this flaw, I implemented the fix in the wrapper class.
* Renamed BagOStuff::set_debug() to setDebug(), since we aren't emulating the memcached client anymore
* Fixed spelling error in MWMemcached: persistant -> persistent
2011-03-03 09:37:37 +00:00
Tim Starling
af04dde290 Start of ObjectCache reorganisation. Moved the object cache files to includes/objectcache/. Split BagOStuff.php into single-class files. 2011-03-03 04:38:17 +00:00