Mostly places which immediately had a:
if ( !is_callable( $callback ) ) {
throw new Exception(...);
}
check at the beginning of the function.
Change-Id: Ia78663b2231629010816bd1cda8814b996968d1d
Needed to allow long-running background tasks to close out database
connections in a way that allows them to reopen later when needed
again.
Bug: T97641
Change-Id: I4974b691392d4225b15e7b771a28a2cefeb9d8e4
JobRunner::run() and API endpoints use this to bail out if
lag is too high. A dedicated "vslow" host with no normal
load should not trigger this logic, for example.
Bug: T135809
Change-Id: If6879aa1a4379857779a4eacf2a8b7400c0b434f
* Make the slave wait methods work properly in this case if
the config flag is set.
* Also fixed a small IDEA error.
Bug: T135690
Change-Id: I9a12f1fc54c0b426f64c19ac2bf720e683fcf2fe
(This is part of I6ec374ac9 wich was a re-submit of Ie98bf5af5
which got reverted by Ide7ab563)
This change provides a mechanism to reset global service instances
in an orderly manner. There are three use cases for this:
* the installation process
* integration tests (which most of the existing phpunit tests are)
In contrast to I6ec374ac9, this change does not cause singeltons
of legacy services to be reset. It is assumed that legacy services
use global state to access services and configuration, so any
change in confuguration would affect them immediately.
NOTE: the original I6ec374ac9 would cause session information to
get lost if the user session was creatsed before initialization
was complete. This was apparently triggered by the MobileFrontend
extension under some circumstances. Check with Addshore and Catrope.
Change-Id: Ie06782ffb96e675c0aa55dc26fb8f22037e8517d
Sometimes, a column name alias is chosen that is a reserved word or is
otherwise invalid (such as an alias named "user" on postgres or mssql).
Let's unconditionally quote the alias so that no matter what the user
specifies, it will not cause the query to error out.
Bug: T118973
Change-Id: If3ea7324980355e78afcdb3bf2596d23bb96412d
The MSSQL schema is now brought in-line with the MySQL schema.
Additionally, various issues that prevented successful installation or
updates via MSSQL were fixed, notably with respect to creating bits of
the database should other bits already exist as well as issues with
previous updater patches not working correctly.
Additional MSSQL bugfixes will come in separate patches, as they are less
related to the schema/install/upgrade process.
Change-Id: If3eea625499d3cb14abba40f528208173067a53a
MSSQL allows for more operators than standard LIKE queries. In addition,
an ESCAPE clause must be specified in order to backslash-escapes to work.
Bug: T73207
Change-Id: Idadf9d56cadc48cf47d000598d8a3214c684f9d5
* Add a note in Database.php that docs are in IDatabase.php,
maybe its just me, but I didn't realize that was where the docs
are (even though in retrospect that should have been obvious) and
wasted a lot of time because I didn't realize that.
* Change references to IDatabase::tableName() in doc to
DatabaseBase::tableName(), since tableName is not in the IDatabase
interface.
* Be explicit in docs for select() about which parts are safe for
user input. I think its important to be very explicit about this.
No code changes, just doc changes.
Change-Id: I3a66477afc6a5f54855062482ef04c2966e468f6
This reverts commit efb4418839. This is the biggest metric
by statsd traffic volume on the Wikimedia cluster. Please re-introduce this
only with sampling.
Bug: T101141
Change-Id: I7bc3b3aaa98dcefe1a80a4f458a83232c29a27ea
This change provides a mechanism to reset global service instances
in an orderly manner. There are three use cases for this:
* the installation process
* forking processes
* integration tests (which must of the existing phpunit tests are)
Depends-On: I5d638ad415fc3840186a0beaa09ac02ea688539b
Change-Id: Ie98bf5af59208f186dba59a9e971c72ea0b63e69
In the age when we require PHP 5.5, pretending that mbstring emulation
is not slow and silly is silly.
Bug: T129435
Change-Id: Ic8235c9da9a926df63ec7388900c44eab454eebe
This makes it easier to support pt-heartbeat with shard "channels"
since the channel is based on the section name.
Change-Id: Ie0128ee2914e8dc0063c759704373b2440df5ed8
* Clean up return value types and docs.
* Handle master switch-over better w.r.t the job queue due
to binlog name changes (the host portion). Previously the method
would fail and trigger read-only mode when waiting on former
master positions. Assume the the switch-over was done properly
and thus return immediately.
Bug: T126436
Change-Id: Ib8c05a5c72d03a5c98e41b23c5653fc194b6d130
I searched for /\$(\S+) = (.+?\(.*?\);)\n.*?\$\1\[/, ignored
everything involving isset(), unset() or array assigments, then
skimmed through the remaining results and changed things where they
made sense. These changes were not automated, so please review them.
Change-Id: Ib37b4c66fc57648470f151ad412210b3629c2538
Specifically in the savepoint part of the code, where a failed query inside the
savepoint gives a non-false reply to pg_last_error by the time we call it,
which then leads to us doing 'RELEASE' instead of 'ROLLBACK TO', and causes
all sorts of mayhem.
The whole system needs a little cleanup, but this is an important bandaid.
Change-Id: I0223a3599816db5650f45863400e6194468d4361
* Remove obsolete @protected tag from docstring
of DatabaseBase::indexName(), now really protected
* Make DatabaseSqlite::indexName() protected too
Change-Id: I90f894878379d0850dba61cd483af16864c209ea
Otherwise, transactions might be committed without cooperative
locks that were supposed to be present. This is similar to the
logic of not auto-reconnecting if a transaction was started to
avoid committing incomplete changes.
Change-Id: Ia7bc6b188bb5ee53a5bf7c5a30718bc7c4dd0ba9
This method is less manual and avoids the usual pitfalls of
not unlocking for a return statement or not flushing out any
prior transaction.
Change-Id: Ib1681244767de860105a68210e181e2f024ee525