objectcache: fix WRITE_ALLOW_SEGMENTS in BagOStuff cas() and add() methods
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 15 Aug 2019 01:31:48 +0000 (21:31 -0400)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 20 Aug 2019 14:55:42 +0000 (10:55 -0400)
commit942f708b61d8d7b79fd3af8415287654e6b79c1c
treed090fa3eb17aaa409db0e5f5addd12cda51d2181
parentc4f0a993baab3ab2f0a8ce00d0086ba3233eb8eb
objectcache: fix WRITE_ALLOW_SEGMENTS in BagOStuff cas() and add() methods

Add MediumSpecificBagOStuff::getValueOrSegmentList() helper method.

Also:
* Use $keysMissing variable correctly in CachedBagOStuff::getMulti()
  to avoid extra overhead.
* Optimize mergeViaCas() when the current value matches the new one.

Change-Id: I5c4bd74379bc459216ac0278150ce3aecff3b851
13 files changed:
includes/libs/objectcache/APCBagOStuff.php
includes/libs/objectcache/APCUBagOStuff.php
includes/libs/objectcache/CachedBagOStuff.php
includes/libs/objectcache/EmptyBagOStuff.php
includes/libs/objectcache/HashBagOStuff.php
includes/libs/objectcache/MediumSpecificBagOStuff.php
includes/libs/objectcache/MemcachedPeclBagOStuff.php
includes/libs/objectcache/MemcachedPhpBagOStuff.php
includes/libs/objectcache/RESTBagOStuff.php
includes/libs/objectcache/RedisBagOStuff.php
includes/libs/objectcache/WinCacheBagOStuff.php
includes/objectcache/SqlBagOStuff.php
tests/phpunit/includes/libs/objectcache/BagOStuffTest.php