* Make getWithSetCallback() accept a TTL field for this
* Make ChangeTag callers use this flag to avoid hundreds of
duplicate queries at Special:Tags
Change-Id: Ic1ed28294f5d557e02f39a7f20d36766244b9ded
This fixes the default $oldOpts value for the case when
$opts is given check keys and no $oldOpts value is passed
in. In that case, the getWithSetCallback() method
variable $opts would be null instead of array().
Change-Id: I825062533478b37766511aae1d06dd4b81f8dba1
* Put 'checkKeys' param in opts array instead of as a separate parameter.
It's neat to not have to skip unnamed/positional arguments that are optional.
* Move TTL to be before callback instead of after. This avoids dangling integers
toward the bottom of a large code block that have no obvious meaning.
Matches BagOStuff::getWithSetCallback.
Add unit test for lockTSE to confirm
Change-Id: I60d6b64fc5dff14108741bafe801fd1fde16d1df
This better handles values that take a long time to
generate. For example if it took 10 sec, then the old
value would not regenerate in time. 30 is a good, high,
value that is the default PHP timeout.
Change-Id: I2e4372bf4c6d28d09347012926d8c0a9deda4183
* This gets lag information that is useful when
the calling code is about to run queries that
will have their results cached.
* This is now used in place of trxTimestamp() for
WANObjectCache set() and getWithSetCallback().
* The WAN cache will use a low TTL if the lag is
too high to avoid caching stale data for weeks.
* Bumped MAX_COMMIT_DELAY as nothing enforces it.
Bug: T113204
Change-Id: I2a95b4088cff42d6e980351555f81a4b13519e24
* Doxygen needs this or the paragraph ends up in the
last bullet point
* Also removed some redundant comments
Change-Id: Ie4bf2b67fff27ecad5f24f55688161fe484c300d
* This can avoid some stale write race conditions
* Made use of this option in a few key places
* HOLDOFF_TTL was also bumped
Change-Id: I83505a59cce0119e456191c3100f7d97bc86bdbf
* They now issue the delete() write before COMMIT of
the relevant DB (or immediately if no trx is active)
* This can avoid some stale write race conditions
* Updated the WAN cache delete() docs
Change-Id: Id54887976051120b76528070d5f2ceb357d57897
* 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
* This still allows If-Modified-Since logic but does not
need to broadcast initialization values just because a
key fell out of cache. The value can differ between DCs
anyway via skew, this just lets them drift more. Actual
purge events are still broadcasted, which is what matters.
* The User class has now been simplified given this change.
* Added more general comments to getCheckKeyTime().
Change-Id: Ic1f4bbb1947e0d1dd47499c9e9dc86991c30580c
* Do not use lock() for tombstoned keys unless lockTSE was set
* Moved the is_callable() check down a bit further
* Also removed one inaccurate comment
Change-Id: I904e0681faa48b1dc2bc2a3c005a29d2f8347065