objectcache: only give current format keys getWithSetCallback() callbacks
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 27 Nov 2017 02:45:09 +0000 (18:45 -0800)
committerKrinkle <krinklemail@gmail.com>
Tue, 28 Nov 2017 21:26:06 +0000 (21:26 +0000)
commitea22e3d1f6677884d8490d744ca15c65fd34c769
tree87b96fa67c71cd1ffd9a9ec185d30c863ddef765
parent2ad99704345ec0e6609743bbf02e8b474fac432a
objectcache: only give current format keys getWithSetCallback() callbacks

Callback code that happens to make use of $oldValue might not be able
to handle missing, new, or changed fields due to key version changes.

Overhaul testGetWithSetCallback_versions() to be cleaner and cover the
case of unversioned => versioned keys.

Change-Id: If108a73078c530c985d30bdadcbfa9ddd53dc2be
includes/libs/objectcache/WANObjectCache.php
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php