Commit graph

306 commits

Author SHA1 Message Date
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
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
jenkins-bot
ad3f83099f Merge "objectcache: fix a few documentation mistakes" 2017-12-01 10:06:10 +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
jenkins-bot
a6f465a5f4 Merge "objectcache: Add @ingroup to RedisBagOStuff" 2017-12-01 06:02:13 +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
Timo Tijhof
5c96292e9a objectcache: Add @ingroup to RedisBagOStuff
Was missing from "Cache" group, as well as from the cross-component
"Redis" group.

Change-Id: I52ebc93cf472a4acc383742e0ea5c15c5a6db537
2017-11-30 15:52:01 -08: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