Commit graph

13 commits

Author SHA1 Message Date
Aaron Schulz
cce813a922 Move MultiWriteBagOStuff to /libs
Also moved related tests files to /libs.

Change-Id: I806eeaa30205733d497adde933baf0c4157f7aae
2015-10-24 12:15:26 -07:00
Aaron Schulz
f84b32af37 objectcache: Remove getWithSetCallback() signature backwards-compatability
All callers have been migrated

Change-Id: I7b6b87594dd724434ba24d8206fe07d66c1d5d25
2015-10-19 23:47:04 +00:00
Aaron Schulz
968e28f894 Add process cache support to WANObjectCache
* 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
2015-10-10 06:14:50 +00:00
Timo Tijhof
09cbebb224 WANObjectCache: Change getWithSetCallback() signature to key/ttl/callback/opts
* 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
2015-10-07 18:03:15 -07:00
Timo Tijhof
14788f9aab objectcache: Fix flaky unit test
Change-Id: Id7d3b75248a42e2e82a51d70a3ee1479f0507685
2015-10-07 17:23:46 -07:00
Aaron Schulz
aaa7df96a4 Added testStaleSet() WAN cache test
Change-Id: Ib8565c48af09af0df1809e877fde9d4d6c7e7038
2015-09-29 18:14:48 -07:00
Aaron Schulz
7d5f3efa2f objectcache: Add WANObjectCache::resetCheckKey() method
Change-Id: I6f8b97c1f4511534e1ab2656f472adee491f9d9f
2015-07-13 21:25:20 +00:00
Aaron Schulz
84758e6f10 Made WANObjectCache::getCheckKey() automatically init the key
* 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
2015-07-02 07:13:22 +00:00
umherirrender
d8821f2b0b Fixed spacing
- Removed space after casts
- Removed spaces in array index
- Added spaces around string concat
- Added space after words: switch, foreach
- else if -> elseif
- Removed parentheses around require_once, because it is not a function
- Added newline at end of file
- Removed double spaces
- Added spaces around operations
- Removed repeated newlines

Bug: T102609
Change-Id: Ib860222b24f8ad8e9062cd4dc42ec88dc63fb49e
2015-06-17 20:22:32 +00:00
Vivek Ghaisas
9f5b6f5aeb Fix whitespace issues around parentheses
Fix issues found by MediaWiki.WhiteSpace.SpaceyParenthesis sniff.

Bug: T102617
Change-Id: Iec7f71e64081659fba373ec20d9d2006306a98f4
2015-06-16 22:14:02 +03:00
Vivek Ghaisas
665f1a033d Ensure that files end with a newline
Bug: T102619
Change-Id: Iae6e722151581d15c9421d41c4d14b100bb6e437
2015-06-16 16:21:57 +03:00
Aaron Schulz
4db819011a Allow for dynamic TTLs in getWithSetCallback()
* This gives it better parity with BagOStuff::set()
* Also updated some doc comments

Change-Id: Ib94b97715fae901bac1750656e3dc7501919d6d2
2015-05-12 13:04:53 -07:00
Aaron Schulz
3a1f8b1111 Added WANObjectCache class
This class handles caching across distance sites where purges
must reach both. It also aims to make purging more reliable in
the face of network glitches and node consistent hash ejection.

bug: T88492
Change-Id: I686811b3075bf22e2f4de45127e8461e54648ead
2015-04-23 21:36:42 +00:00