Commit graph

180 commits

Author SHA1 Message Date
Aaron Schulz
bde2c5aa9e objectcache: clean up language about expiration/invalidation
Change-Id: I593e7bf9bd4f7fbb615d3d164e77273bd4033dde
2018-06-05 23:45:19 +00:00
jenkins-bot
966e34619b Merge "objectcache: add setMockTime() method to BagOStuff/WANObjectCache" 2018-06-01 13:19:24 +00:00
Aaron Schulz
acace9a049 objectcache: add setMockTime() method to BagOStuff/WANObjectCache
Change-Id: I3e5760814fb7dbe628eb0d979d690c3275fc3c15
2018-06-01 03:46:58 +00:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
Aaron Schulz
5c55f5d912 objectcache: improve TTL reduction warning log entries
Add "lag" and "age" parameters for more context

Change-Id: Iea029e78d4c0bbec0e4334de4fbe7780b1bea524
2018-02-22 10:07:40 -08:00
Aaron Schulz
8e89785e25 objectcache: add IExpiringStore::TTL_SECOND constant
Change-Id: Iec59ce72f3dbb0de68c8f6704d86f1522f86827e
2018-02-16 14:23:49 -08:00
Aaron Schulz
32907f4f99 objectcache: improve WANObjectCache reap method comments
Change-Id: Icec0846b0e66229af39bb819d75144734fd111bf
2018-02-15 11:53:45 -08:00
Aaron Schulz
d9f0a5f685 objectcache: remove unused constant and expand on a comment
Change-Id: I3342497d657291d20325a3d87cc634f53d7776c4
2018-02-07 16:15:32 -08:00
Aaron Schulz
7206bd3468 objectcache: use region prefixes for mcrouter-backed WAN cache
This allows for mcrouter to have proper cross-DC and intra-DC timeouts.

Change-Id: If48f740f435d266a2050839f34611c0c8f36b3a7
2018-02-01 10:09:44 -08:00
Aaron Schulz
9a4dc4b755 objectcache: add some WANObjectCache comments to set() and delete()
Change-Id: I527f1244c5c7cece888ace25e7a01653cf2b9542
2018-01-29 17:29:20 -08:00
Umherirrender
23ef520a1c Improve some parameter docs
Change-Id: I31e983d7ac287158101b18ad95779d83537302a2
2018-01-07 11:39:08 +01:00
Aaron Schulz
32c4831cf1 objectcache: fix getMultiWithUnionSetCallback() doc
Change-Id: I5700ff8ccbe2ef3aa6730e20bdc17314bceade42
2017-12-20 14:24:43 -08:00
Aaron Schulz
b62327eee7 objectcache: add another example case to WANObjectCache::getWithSetCallback()
Change-Id: I4beb1441790f5371d9fe55ca05cd17dc9fcdcf80
2017-12-15 12:05:35 -08:00
Lucas Werkmeister
5f5b79eea2 Remove unused 'pool' param from WANObjectCache::newEmpty()
The 'pool' parameter was removed in commit 09a0a5e4f6 (change
I5631eb1b13), retaining it in this helper method just confuses people
who read the code.

Change-Id: I7907a1fc4c613362d74e9045bc7dc41bbd9bf815
2017-12-11 18:30:55 +01:00
Aaron Schulz
78468c0147 objectcache: various cleanups to WANObjectCache
Change-Id: Ibc3c7e59b47b4f9b982176f81dff9f81d99de460
2017-12-01 15:25:40 -08:00
Aaron Schulz
e3b6f7ef4d objectcache: add example use case to WANObjectCache::getMultiCheckKeyTime()
Change-Id: I874070d2f770be7f9e06c381b2413f6e133418b8
2017-12-01 14:29:56 -08:00
Aaron Schulz
b29ee7a960 objectcache: add WANObjectCache::getMultiCheckKeyTime method
Change-Id: I5675fabc5aa70f72659ce02d68caae88be20e06d
2017-12-01 21:45:32 +00:00
jenkins-bot
bd78292e75 Merge "objectcache: Run preemptive WAN cache refreshes post-send" 2017-12-01 19:08:31 +00:00
Aaron Schulz
73b928750c objectcache: Run preemptive WAN cache refreshes post-send
This keeps HTTP request time consistent in case of expensive keys

Change-Id: I0746fde29a6e2f27d1b92f1af599c741d5972f46
2017-12-01 08:15:26 +00:00
Aaron Schulz
976cb7035b objectcache: fix a few documentation mistakes
* Fix useInterimHoldOffCaching() description
* Mention when staleTTL and graceTTL where added

Change-Id: Iea24b77f6816251e9dac814dc57f6a44382a3cea
2017-12-01 06:16:16 +00:00
Aaron Schulz
e90eafdf61 objectcache: Make WANObjectCache interim caching not interfere with ChronologyProtector
Also removed useless line from testLockTSE(). That would have needed
to be using $this->internalCache and those locks are freed immediately.

Bug: T180035
Change-Id: Ida1a923f779aaf8410da76643457d2200da6cb20
2017-11-30 23:54:22 +00:00
Aaron Schulz
ee14393358 objectcache: use INTERIM_KEY_TTL constant in WANObjectCache for readability
Change-Id: I13936397def11a13849fe14491b752dd797f6759
2017-11-28 21:59:28 -08:00
Aaron Schulz
ea22e3d1f6 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
2017-11-28 21:26:06 +00:00
Aaron Schulz
2ad9970434 objectcache: add more comments to WANObjectCache
Change-Id: I567f45fa7b33226b0ccf7d80440802eab71ff753
2017-11-28 21:17:48 +00:00
Aaron Schulz
300c655377 Use time forcing methods to avoid WANObjectCacheTest flakeiness
Use of microtime() is now just for baselines, and it is no longer
assumed to be increasing with each call. Such an assumption is
particuliarly bad on Windows.

I've done 100X run rounds with now failures on Windows.

Change-Id: Ica2a47982495bc95b10ca507414972744ea9507e
2017-11-28 06:50:44 +00:00
jenkins-bot
fb7979f479 Merge "objectcache: add "graceTTL" option to WANObjectCache::getWithSetCallback()" 2017-11-28 02:21:50 +00:00
Aaron Schulz
0d7137099a objectcache: add "graceTTL" option to WANObjectCache::getWithSetCallback()
Also made worthRefreshExpiring() fully match the method documentation.

Change-Id: I48a4b1b9d006de100389b47c03c1185a9316abfc
2017-11-27 17:11:13 -08:00
Aaron Schulz
b633233c04 objectcache: make adaptiveTTL() use getCurrentTime() for completeness
Change-Id: I5ba3c39ccaf412b0aaecd64d52ab15b2075bc76c
2017-11-27 09:45:46 -08:00
jenkins-bot
785960660f Merge "objectcache: add "staleTTL" into WANObjectCache::getWithSetCallback()" 2017-11-26 21:55:47 +00:00
Aaron Schulz
fce6862e46 objectcache: add "staleTTL" into WANObjectCache::getWithSetCallback()
This simply involves passing it through to the set() call

Also added some related commons to adaptiveTTL() involving
usage of this option.

Change-Id: Id5833a5d4efb6cad2eb646832e5b0188e86e12fc
2017-11-26 21:49:47 +00:00
Aaron Schulz
4ebcc581e1 objectcache: improve touchCheckKey()/resetCheckKey() comments
Change-Id: I91de1dff605adcf86e957bbf9e503fc4e5eed741
2017-11-23 03:44:57 -08:00
Aaron Schulz
1772c4fe34 objectcache: add some WAN cache preemptive refresh tests
Added some extra sanity checks to WANObjectCache

Change-Id: Iac511b0cc1fc8d57ac98e9d7f2cacbcddc1c6db9
2017-11-22 18:38:53 -08:00
Aaron Schulz
7dbd6bff34 objectcache: add WANObjectCache::STALE_TTL_NONE constant
Also improved the documentation around "staleTTL".

Change-Id: Iae3377cbf58d8aa2c70f75586f183089a8bec92f
2017-11-21 14:09:08 -08:00
jenkins-bot
c8dcf35850 Merge "objectcache: fix some makeKey/makeGlobalKey IDEA warnings" 2017-11-20 20:51:26 +00:00
Aaron Schulz
f23fb835fc objectcache: make sure variant keys are namespaced as keys should be
Change-Id: I02597d6dbc2febace25ef6d1981f69dc704efe8d
2017-11-20 20:32:44 +00:00
Aaron Schulz
93120703f6 objectcache: fix some makeKey/makeGlobalKey IDEA warnings
Change-Id: I5fefda9676a685167326c63c34b2b7df8be2e7cd
2017-11-18 19:57:26 -08:00
Chad Horohoe
444073ddbc Group messages in WANObjectCache by key
Change-Id: I31c570a095735c9157332660e9f1f542e679410f
2017-11-08 20:20:05 +00:00
jenkins-bot
6ff59f4979 Merge "Add statsd metric support to WANObjectCache" 2017-11-01 01:19:08 +00:00
Brad Jorsch
3488f49532 Replace selectFields() methods with getQueryInfo()
Several classes have a "selectFields()" static method to tell callers
which fields to select from the database. With the recent comment table
change and the upcoming actor table change, this pattern has become too
simplistic as a SELECT will need to join several tables to be able to
retrieve all the needed fields.

Thus, we deprecate the selectFields() methods in favor of getQueryInfo()
methods that return tables and join conditions in addition to the
fields.

Change-Id: Idcfd15568489d9f03a7ba4460e96610d33bc4089
2017-10-30 22:57:33 +00:00
Aaron Schulz
4432e898be Add statsd metric support to WANObjectCache
Bug: T178531
Change-Id: I3037281d09cd5195347789f544deae89711f128b
2017-10-25 01:41:31 +00:00
jenkins-bot
f73f2b320d Merge "objectcache: Always use interim values on WAN cache tombstones" 2017-10-24 00:42:46 +00:00
Aaron Schulz
6b2f13b055 objectcache: Always use interim values on WAN cache tombstones
This stores values for very short times while the main
value is a tombstone in case of particularly high traffic.

Also make mutex keys expire immediately on unlock.

Change-Id: I4ec5cf7f8b49239fdd2518e5d955534877a0f7ee
2017-10-24 00:32:06 +00:00
Aaron Schulz
31f87d19e5 objectcache: Add more hotTTR comments to WANObjectCache
Change-Id: I123e5231206350ee51098fcb6528da126d1a86ce
2017-10-24 00:28:24 +00:00
jenkins-bot
1380b0dbea Merge "objectcache: Split off some code in WANObjectCache::getWithSetCallback" 2017-10-20 17:18:39 +00:00
Aaron Schulz
0fe50ad759 objectcache: Split off some code in WANObjectCache::getWithSetCallback
This makes it a bit easier to follow

Change-Id: I67968814ab046473eb8eca4086a8600c77417b82
2017-10-20 17:12:21 +00:00
Aaron Schulz
317d8476da objectcache: Mention colons in BagOStuff key generation
Change-Id: I76967245c32aac4eea8d6672e4fc1fac5e5f3d07
2017-10-20 03:26:25 +00:00
Brad Jorsch
fa4a909def Replace more uses of "SELECT *"
With the introduction of CommentStore, selects from various table
require certain joins or column aliases for proper operation. The
upcoming actor table change, and the suggested title table change, will
add more such requirements.

Change-Id: Ic8213bff74b8350b15cd271d0ef252e63e7e79bd
2017-10-13 19:02:56 +00:00
Umherirrender
86463f3df6 build: Updating mediawiki/mediawiki-codesniffer to 0.12.0
Change-Id: Iefaae5043fa77d5d556c31079549dab8f61bd3ef
2017-09-10 21:11:37 +02:00
Umherirrender
3f1a52805e Use short type bool/int in param documentation
Enable the phpcs sniffs for this and used phpcbf

Change-Id: Iaa36687154ddd2bf663b9dd519f5c99409d37925
2017-08-20 13:20:59 +02:00
Umherirrender
ace44e2064 Use correct variable name in @param documentation
For some varargs a variable name is added with suffix ,... as seen for
many other varargs

Some @param are swapped, because there are in the wrong order

Enable Sniff MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

Change-Id: I60fec6025bce824d5c67563ab7b65ad6cd628ad8
2017-08-11 19:27:19 +02:00