Improvements to WANObjectCache::getWithSetCallback()
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 18 Sep 2015 19:22:18 +0000 (12:22 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 23 Sep 2015 15:24:01 +0000 (15:24 +0000)
commit1ed292fa9ed97d72fb8412bc18b393e6a9f758e7
tree3758fa80c66b17e227abe87d814f2a8e4f032a64
parent924a40410b42c56e389d03d871df31364ee69159
Improvements to WANObjectCache::getWithSetCallback()

* If lockTSE is set, make sure it applies during during
  the entire duration of a key being tombstoned. This lets
  regenerations happen during that whole time, which lowers
  the chance of seeing stale data if the DBs are lagged.
* If lockTSE is not set, do not apply tempTTL (for tomstoned keys).
  If traffic is high, a stale value would usually be "stashed" and
  used for 5 seconds. If the lag was only 1 second, then this
  is suboptimal.
* Determine tempTTL from lockTSE as they no longer make sense
  being separate. This makes things easier to understand and
  also makes the lockTSE value account for the last regeneration
  time (via stash key TTL). Since LOCK_TSE << HOLDOFF_TTL, this
  helps avoid stale reads without adding stampede risk.

Change-Id: I3b01f0ec67935a238b30e02e42004fd3b2dcfb9d
includes/libs/objectcache/WANObjectCache.php