This affects most LCStoreDB which is the default cache
and spamming the log.
Bug: T154424
Bug: T97693
Change-Id: I68af177c7d0d88ab266eb3fefb4336eff86d861c
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
The "AUTO" means AUTOCOMMIT, not "automatic transactions"/DBO_TRX,
which is basically the opposite concept. The new name does not
suffer from that ambiguity.
Keep the old constant as an alias for backwards compatibility.
Also remove LoadBalancer comment about non-existing field
Change-Id: I63beeb061fc9be73f320308e4d6393b58628b8c8
This is useful for things like SqlBagOStuff and JobQueueDB
being able to write in auto-commit mode while the main
transaction round still goes on.
SqlBagOStuff already had this sort of logic.
JobQueueDB now also takes this approach so it does not have to
defer insertion except for sqlite. This makes callers more likely
to know when insertion failed or not.
Make sure LoadBalancer sets "master"/"replica" LB info itself;
this fixes a bug found in the new tests.
Bug: T140338
Bug: T42451
Change-Id: I4199a9598d7afbf976a6efa8ed84b85b56da02bd
The flags to the driver use new connections for new LBs since
fda4d46fc4. This makes it consistent with what we do for
MySQL already.
This should fix warnings about TransactionProfiler in objectcache,
as well as warnings about "Pending writes" in WANObjectCache.
Bug: T167946
Bug: T154424
Change-Id: I0b0d9a7210b6a3270d32df778fcc4b9918d3dcd1
The WMF parser cache tables have some 30000 rows with an identical, old
expiry time. So each time deleteObjectsExpiringBefore() is run, the
first batch on each table is correct, but the keys for the second batch
are selected with exptime > X, where X is shared exptime of the many old
rows.
So, use exptime >= X instead.
Change-Id: I6853f64f88f65d4529be2a42c9ed70cfa62cf653
If $wgMainCacheType = CACHE_ACCEL, but there is no APC, then its
possible that CACHE_ANYTHING will default to CACHE_NONE because
that's what CACHE_ACCEL would do.
Possibly also T147161
Bug: T160519
Change-Id: I9ac2d071437b35a0f9cd3678e2279628f7b1931e
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.
Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
While prepping the code base for using etsy/phan i found a few problems.
A couple are real problems, while others are just places etsy couldn't
figure out the types.
* AuthPlugin referenced UserLoginTemplate which doesn't exist. Tracing
back usages this accepts classes that extend from BaseTemplate.
* DatabaseSqlite had an invalid @var annotation.
* LoadBalancer had some missing or under-defined annotations. Make them
more specific where possible.
* SqlBagOStuff didn't have the appropriate use statement for
WaitConditionLoop and probably doesn't work. Also updated annotations
that point to non-existent DatabaseBase to use IDatabase.
Change-Id: Iff2270b418ad2f8f97cfdb6df646c435d3283536
$ php maintenance/eval.php
> $wgMessageCacheType = CACHE_ACCEL;
> wfGetMessageCacheStorage();
PHP Warning: Illegal offset type in isset or empty in includes/objectcache/ObjectCache.php on line 93
PHP Warning: Illegal offset type in isset or empty in includes/objectcache/ObjectCache.php on line 125
PHP Notice: Array to string conversion in includes/objectcache/ObjectCache.php on line 133
Caught exception InvalidArgumentException: Invalid object cache type "Array" requested. It is not present in $wgObjectCaches.
#0 includes/objectcache/ObjectCache.php(94): ObjectCache::newFromId(Array)
#1 includes/objectcache/ObjectCache.php(287): ObjectCache::getInstance(Array)
#2 [internal function]: ObjectCache::getLocalServerInstance(Array)
#3 includes/objectcache/ObjectCache.php(181): call_user_func('ObjectCache::ge...', Array)
#4 includes/objectcache/ObjectCache.php(137): ObjectCache::newFromParams(Array)
#5 includes/objectcache/ObjectCache.php(94): ObjectCache::newFromId(3)
#6 includes/GlobalFunctions.php(3430): ObjectCache::getInstance(3)
#7 maintenance/eval.php(78) : eval()'d code(1): wfGetMessageCacheStorage()
#8 maintenance/eval.php(78): eval()
#9 {main}
This reverts commit 6d99fa5824.
Change-Id: I4d756eb6f66318a12d8cbbc1ba546397be8a29bf
* If cache CACHE_NONE or "hash" is not set yet or was unset,
return the proper new object anyway for sanity.
* Also fixed $params typo in newFromParams(). This should not
have any effect since SqlBagOStuff ignores the key in this case.
* Removed excess "use" statement.
Change-Id: I36108a865273b9c209145828e5e1216b545ef431
* Use OutputPage::output() as the method to mask latency, since it
takes a good while to run. By the time it runs, cache replication
should have caught up, so the reap call will likely not block.
* For redirects emitted after changes in POST, instead of masking
with OutputPage, add a parameter to the redirect and block on
the positions appearing. This uses the redirection RTT to mask
the replication latency.
Change-Id: Ib23690c302e8033610fef9a0ef451dafe8a5803e