This makes the code more consistent with the other class methods
that iterate over connection handles and less fragile.
Change-Id: Ie2d8efb80a66a5c87b5b3edd64cb6bc4268fa911
Instead of iterating through load balancer info, just set the flag in
the master and replica connections, since that seems more robust.
Deprecate LoadBalancer::setServerInfo() and
LoadBalancer::getServerInfo(), no remaining callers in core or
in-tree extensions, I think I added the function just for this feature.
Do a service reset, since Logger instances are injected into
LoadBalancer by ServiceWiring (via MWLBFactory::applyDefaultConfig()).
Similarly CryptRand, MimeAnalyzer.
Fix the usage text for shell.php
Change-Id: I3e85a6e8cfa1243a0371cfb3ce1c18665e8c711d
* Make sure waitFor() always handles laggedReplicaMode updates,
even if the actual waiting was deferred until a connection was
needed.
* Restore the old mWaitForPos in waitForOne()/waitForAll() since
this do not care about the generic reader index or the sort of
ChronologyProtector logic related to it.
Change-Id: I0767e9831b8fd7fd115a472354977e3c1e12114a
This avoids two versions of MediaWiki fighting over Rdbms
namespace changes. A simple version string works since there
are no purges issued; it is TTL-based only.
Change-Id: Ie155c20352e8fea00ea469d162d25bda3600ae60
All callers are in core and have been updated.
Other callers can now be switched from LoadBalancer type hints to
ILoadBalancer type hints. Once that migration is done, the classes
implementing it can be moved too.
Change-Id: I6b34099b5816dd8bf9646ed39f7a2d1960e2ed06
This is useful when IMaintainableDatabase methods are needed
for foreign wiki connections to things like external store.
Also:
* Set visibility for ExternalStoreDB methods.
* Cleaned up various type hints and comments.
Change-Id: Ie35b1ff21032cc4e78912dc499486da23aeba041
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
Causes HHVM 3.12.7 to segfault and or:
Fatal error: Stack overflow in includes/libs/objectcache/BagOStuff.php on line 754
This reverts commit b47ce21cec.
Bug: T150833
Change-Id: Ia52fdf65f5e386c0eaa1046328680fb5c8a9081a
This works by setting a callback to return the cache set
options. The callback will watch DB reads and create a
merged result from said usage.
This handles callers that are missing getCacheSetOptions().
Change-Id: Ia264f011e45e8cf105480955dad7e2c4c2357b73
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.
Also update some defect links.
Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
* Remove non-connection magic case when no DB $user
is given. This was removed from the base class.
* Use PGSQL_CONNECT_FORCE_NEW to let LoadBalancer
handle connection reuse. This makes it work like
the mysql classes.
* Make postgres connection error messages actually
be useful by using the PHP error when possible.
This makes it clear if the problem is authentication
or something else and so on.
Change-Id: I3fd76c1e2db8d6008074f5347b201554579b549a
* Make isTransactableQuery() exclude CREATE/ALTER.
Starting transactions for schema changes like this can cause
errors as it is not supported for MySQL and some Postgres
operations. Note that temporary tables are session-level,
so they are not effected by this change.
* Clean up the transaction logic in determineCoreSchema()
so a transaction is not left dangling.
* Fix broken getSchemaPath() call in PostgresInstaller.
* Avoid warnings in DatabasePostgres::closeConnection() if
mConn is already unset.
* Commit master changes in doMaintenance.php before running
deferred updates, just as MediaWiki.php does.
* Change E_WARNING to E_USER_WARNING to avoid notices in the
default /rdbms error handlers.
* Also avoid trying to rollback in MWExceptionHandler if the
LBFactory service is disabled, which just results in an error.
Bug: T147599
Change-Id: I64ccab7f9b74f60309ba0c9a8ce68337c42ffb0f
* Close the master connection in safeWaitForMasterPos() if created.
* Remove unnecessary reuseConnection() calls.
* Add DOMAIN_ANY constant for readability.
Change-Id: I9e64a7405e0eedc50e7b93d05d65cf00d5544a77
* This avoids collisions of generic and custom LB group
server list keys, which could cause warnings and errors.
* Remove $group param from scaleLoads(), which was unused
and less robust for making keys anyway.
* Remove clearCaches() method, which only had one caller
in a script that printed lag times in a loop. Its not
worth keeping and having to pass in the server index
list.
* Also guard scaleLoads() against recent server additions.
Bug: T147359
Change-Id: Idd15f0bebb68782fda36f483880cf7fe9673b940
* Recently pooled servers will get more traffic as
their internal caches warm up by getting queries
* Also let LoadMonitor support options for flexibility
The "loadMonitor" config field now takes in array in
LoadBalancer.
* Make LoadMonitor the default instead of LoadMonitorNull.
Change-Id: I53b89b0c25bdcc30deec3f8b502fb14479c53ae8