Commit graph

327 commits

Author SHA1 Message Date
Fomafix
43244db9a2 Use PHP 7 '??' operator instead of if-then-else
Change-Id: If9d4be5d88c8927f63cbb84dfc8181baf62ea3eb
2018-10-21 21:46:46 +02:00
Aaron Schulz
d2c2bf6553 objectcache: avoid using heavily time-drifted microtime() values in WAN cache
Change-Id: Ifcb9e4b4a1d5adfdaaa6ea505e34956516b871de
2018-10-18 11:42:27 -07:00
Timo Tijhof
2d35c4e997 objectcache: Improve WANObjectCache doc for update strategies
Also add headings to separate docs for deployment/administration,
from docs for developers using an existing instance of it.

Change-Id: Id43c7700564c2979549afa5379f644027fb6585b
2018-08-27 03:46:54 +00:00
Fomafix
0a0d5cb7f7 Fix typos
Bug: T201491
Change-Id: I25a27d11faabe2f5fa02950c7a4fb58b13fb3662
2018-08-14 09:52:19 +00:00
jenkins-bot
55ffac2024 Merge "objectcache: add "epoch" parameter to WANObjectCache" 2018-08-08 23:16:40 +00:00
Aaron Schulz
4af7fbd76a objectcache: add "epoch" parameter to WANObjectCache
This can be used to discard all values before a certain point in
time, such as periods of severe network problems or misconfiguration
that resulted in missed purges.

Change-Id: I612db8f91a5960b912e9f35645a3d3872df47460
2018-08-06 16:43:50 -07:00
Reedy
a075271157 Update composer/spdx-licenses to 1.4.0 and mediawiki/mediawiki-codesniffer to 21.0.0
https://github.com/composer/spdx-licenses/compare/1.3.0...1.4.0

Change-Id: I39f7a1310455159866bfed5224536e800befec0d
2018-07-26 17:44:28 +00:00
jenkins-bot
d80a3827ab Merge "objectcache: improve logging and error handling in BagOStuff" 2018-07-25 04:16:18 +00:00
Aaron Schulz
c705435628 objectcache: improve logging and error handling in BagOStuff
Bug: T198239
Bug: T199383
Change-Id: I0b4110396d03b98e83a7b614caf57d7e7c284361
2018-07-24 19:11:37 +00:00
Aaron Schulz
12200a2332 Make MultiWriteBagOStuff use the native merge() of each backend
This lets backends that support CAS take advantage of it.

Also fix race condition with merge() in asyncWrites mode where two
threads might add to a list/set but the first request finishes after
the second, which would erase an item during the set().

Bug: T198239
Change-Id: Ibd2539429746f12b4de74d0f031089cb80aa8b4b
2018-07-18 22:30:56 +01:00
Aaron Schulz
de51ba46f6 objectcache: switch WANObjectCache process cache to MapCacheLRU
Change-Id: I60d8de99e9590bfef6009f133723bb10d5837c52
2018-07-18 17:57:00 +00:00
jenkins-bot
df6491f78b Merge "objectcache: make BagOStuff::mergeViaLock() timeout more sensible" 2018-07-17 01:09:25 +00:00
jenkins-bot
2252838b4a Merge "objectcache: minor fix to MultiWriteBagOStuff::doWrite()" 2018-07-17 01:00:06 +00:00
jenkins-bot
1fe53f1a33 Merge "objectcache: avoid direct "bag" field references in CachedBagOStuff" 2018-07-16 09:23:55 +00:00
Aaron Schulz
b8779134ed objectcache: make BagOStuff::mergeViaLock() timeout more sensible
Interpret "1 attempt" as non-blocking and use 3 seconds otherwise
(instead of 6 seconds). This means that the WAN cache merge call
does not block.

Bug: T198239
Change-Id: Ieb194a949f18785c2cc9dd20fdc4d2e3fed51abf
2018-07-12 16:02:38 +01:00
jenkins-bot
b108657ace Merge "objectcache: make CachedBagOStuff implement makeKeyInternal()" 2018-07-12 03:22:36 +00:00
Aaron Schulz
32d8dd04f0 objectcache: minor fix to MultiWriteBagOStuff::doWrite()
For the case of add(), any non-zero index can have async writes

Bug: T198239
Change-Id: I95f63143dcb894b9d12859c221f7d8e72fdf076f
2018-07-12 02:50:35 +00:00
Aaron Schulz
9b51250522 objectcache: make CachedBagOStuff implement makeKeyInternal()
Change-Id: I38821d131982d103b9d130e7310bc652f57ea696
2018-07-11 12:43:28 +00:00
Aaron Schulz
c974d0cd7c objectcache: avoid direct "bag" field references in CachedBagOStuff
Change-Id: I853e2e3a33c7f765f74c7273e1b118b1ebf4e84c
2018-07-11 13:43:03 +01:00
Aaron Schulz
8664804e38 Implement makeKeyInternal() for ReplicatedBagOStuff/MultiWriteBagOStuff
Make these proxy to the "write"/"main" cache backend like the other
key methods.

Change-Id: Ie176577d9b52807493d6da9eea963ba440b86330
2018-07-10 13:25:04 +01:00
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
jenkins-bot
ab5edd6ea2 Merge "RESTBagOStuff: improve timeouts and logging" 2018-07-03 11:18:43 +00:00
Aaron Schulz
6612407f9c objectcache: make MultiWriteBagOStuff handle duplicate add() operations
Bug: T198280
Change-Id: Ib1bcde2b3fbfb452f80d8d840c494be2eb70eb87
2018-06-28 16:04:35 +00:00
Aaron Schulz
61a7e1acd0 objectcache: define makeKey()/makeGlobalKey() for ReplicatedBagOStuff
Proxy to the "master"/"write" cache object method. This is similar to the
approach taken in MultiWriteBagOStuff

Bug: T198279
Change-Id: If0933246b7ef4fc07ebeec4c3c9625b1137dbe05
2018-06-27 14:16:01 +00:00
Tim Starling
c21daeebe0 RESTBagOStuff: improve timeouts and logging
* Provide a sensible default for the HTTP timeout, and make it configurable.
* Also make HTTP proxy and caBundlePath configurable.
* Pass through the logger object to the HTTP client, as in EtcdConfig.
* Do not treat a 404 response code for DELETE or 204 for PUT as errors. The
  doc comment already said that delete() should return true if the item
  was not found.

Change-Id: I6a90a25339c3a433381a5300c8c7c1a644e2a10f
2018-06-21 09:34:02 +00:00
Aaron Schulz
626c5f6972 objectcache: change "miss" to "renew" in metric name for preemptive refreshes
This will usually let one distinguish asynchronous preemptive cache refreshes
from synchronous value recomputations due to actual cache misses.

Change-Id: I3424a89cc96a12fe283460eeaf722ee0cf299534
2018-06-20 15:23:35 +00:00
Max Semenik
1e680456b4 Get rid of call_user_func(_array)(), part 3
Also cleaned up nearby code in a couple places.

Change-Id: Ibf44ee7c0ceb739d7e79406e4ff39303c316e285
2018-06-10 02:21:24 +00:00
jenkins-bot
dc6d8d2c3e Merge "objectcache: clean up language about expiration/invalidation" 2018-06-06 00:12:01 +00:00
Aaron Schulz
bde2c5aa9e objectcache: clean up language about expiration/invalidation
Change-Id: I593e7bf9bd4f7fbb615d3d164e77273bd4033dde
2018-06-05 23:45:19 +00:00
Aaron Schulz
7a730a6f9e objectcache: update MemcachedPeclBagOStuff for pecl memcached 3.0.0
The get() $cas_token parameter was changed into $flags, which can act
as a switch to make the return value an associative array of details.

pecl and PHP-based memcached BagOStuff class both pass all tests now.

Bug: T196125
Change-Id: I4678250331a48db4d50d1fc6c489c991a4dee920
2018-06-02 17:25:22 -07:00
jenkins-bot
285080c311 Merge "objectcache: make RedisBagOStuff pass all tests" 2018-06-02 01:35:26 +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
Aaron Schulz
13f7232bf4 objectcache: make RedisBagOStuff pass all tests
* Provide a default lock-based BagOStuff::cas implementation
* Make RedisBagOStuff::merge() use mergeViaCas()
* Use the raw unserialized string as the redis CAS token to
  avoid any bad interaction with __wakeup() methods changing
  field values every time
* Make RedisBagOStuff::incr() return false when there is no
  such key, not null
* Rewrite merge() test to make the order of write/cas phase
  of the parent and child merge() calls well defined instead
  of arbitrary usleep() calls
* Avoid cache key reuse in test runs

Change-Id: I388ec173cf3858bb2fc7a8c8a00cda68703074ce
2018-05-31 20:43:10 -07: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
f81853ed53 objectcache: add BagOStuff comment additions about access scope
Change-Id: Id23859a58ea3bde0338ba4d22ce12ffcbbf4480a
2018-05-17 05:23:24 +00: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
Reedy
39f0f919c5 Update suppressWarning()/restoreWarning() calls
Bug: T182273
Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f
2018-02-10 08:50:12 +00:00
jenkins-bot
a4746650a3 Merge "objectcache: remove unused constant and expand on a comment" 2018-02-08 06:46:38 +00:00
Aaron Schulz
d9f0a5f685 objectcache: remove unused constant and expand on a comment
Change-Id: I3342497d657291d20325a3d87cc634f53d7776c4
2018-02-07 16:15:32 -08:00
Chad Horohoe
5c93fabafd Drop XCache support
It was never super popular anyway, APC was always the best option.
The project has no plans to move to PHP7, so it's quickly reaching
its end of life. Oh, and Fedora dropped it from their repos 2 years
ago.

Change-Id: Ia3257e86a6323d8943f04a5c05c72c0bd4c4b0a9
2018-02-07 13:45:40 -08:00
Kunal Mehta
79de8fd02f Use wikimedia/object-factory 1.0.0
Deprecate the unnamespaced version and move it to includes/compat.

Bug: T147167
Depends-On: I39c805bfb98b32f32f3d0dc1eee9e823afe1c21a
Change-Id: I3780c7adf51683f3f7adb35a88f9a25a0a2e2530
2018-02-04 12:52:44 -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
jenkins-bot
a18476eab3 Merge "Remove @param comments that literally repeat what the code says" 2018-01-11 23:48:03 +00:00
Thiemo Mättig
ef470ebf7f Remove @param comments that literally repeat what the code says
These comments do not add anything. I argue they are worse than having
no comments, because I have to read them first to understand they
actually don't explain anything. Removing them makes room for actual
improvements in the future (if needed).

Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
2018-01-10 14:14:26 +01:00
Umherirrender
23ef520a1c Improve some parameter docs
Change-Id: I31e983d7ac287158101b18ad95779d83537302a2
2018-01-07 11:39:08 +01:00
Umherirrender
255d76f2a1 build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
Clean up use of @codingStandardsIgnore
- @codingStandardsIgnoreFile -> phpcs:ignoreFile
- @codingStandardsIgnoreLine -> phpcs:ignore
- @codingStandardsIgnoreStart -> phpcs:disable
- @codingStandardsIgnoreEnd -> phpcs:enable

For phpcs:disable always the necessary sniffs are provided.
Some start/end pairs are changed to line ignore

Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
2018-01-01 14:10:16 +01:00