Commit graph

69 commits

Author SHA1 Message Date
libraryupgrader
5357695270 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs now pass and were enabled:
  * Generic.ControlStructures.InlineControlStructure
  * MediaWiki.PHPUnit.AssertCount.NotUsed

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)

Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
2021-07-22 03:36:05 +00:00
daniel
aa7fada9dc Avoid errors in CLI mode when user has no name
MWLBFactory tries to determine the current user's name using
posix_getpwuid(). This will however fail if the current user has no
name, which is the case when running in our standard docker environment.

Bug: T283191
Change-Id: If814d791ee7061d8632ae04602cf489b06422eee
2021-05-19 17:46:49 +00:00
jenkins-bot
f2bf455fa4 Merge "rdbms: Use REQUEST_TIME_FLOAT for LBFactory::getCPInfoFromCookieValue" 2021-04-29 01:42:36 +00:00
Timo Tijhof
b2f4bef111 rdbms: Use REQUEST_TIME_FLOAT for LBFactory::getCPInfoFromCookieValue
This means we'll consider a slightly more ChronologyProtector cookies
that are near their expiry. This is perhaps not so useful since that's
also near the time where max replication lag kicks in, and the storing
of the CP data itself is going to be evicted.

But, this may be a more predictable and stable reference point than
"current" time, considering that as of I3140922cec130cad, this
computation now happens lazily at the first call to LBFactory, instead
of during Setup.php, so in a way this change just brings it back to be
closer to the start of the request (except even earlier than it was
before I3140922cec130cad, since before that commit we did wait until
after the first few ~ milliseconds of multiversion, autoloader,
composer, etc.).

Bug: T228895
Change-Id: I76e2130431ab44344eea93ce8f4f8b2322840819
2021-04-28 21:55:27 +00:00
jenkins-bot
aadbffb9ae Merge "rdbms: Move setLBFactoryTriggers from doMaintenance to service wiring" 2021-04-28 00:23:38 +00:00
Timo Tijhof
e9051b2b99 rdbms: Move setLBFactoryTriggers from doMaintenance to service wiring
This logic is not needed to run on every PHP process and was making
it difficult to run offline maintenance scripts without additional
complexity based on Maintenance::getDbType and DB_NONE.

Instead of skipping this only for DB_NONE, and establishing a pattern
that may spread to other ad-hoc places throughout the codebase, instead
remove this entirely from the eager set up code for all PHP processes
and move it to the service wiring and dependency injection.

That way, it naturally doesn't happen until and unless the DB service
is actually called upon. Scripts and entry point that need to disable
the DB service, can continue to use
MediaWikiServices::disableStorageBackend.

== Impact on SiteStatsUpdate ==

With wgCommandLineMode no longer being read at run-time from a global,
but in service wiring, this means SiteStatsUpdateTest can't change
the behaviour between CLI-like and Web-like, unless it e.g. resets
the 'DBLoadBalancerFactory' service first. Unfortunately, while most
any reset is supported, a reset of the 'DBLoadBalancerFactory' would
be unsupported as that would lose the temporary db clone context and
such, bringing us to either the developer's live db, or a broken set
up altogether. If there is a strong need for toggling oppertunistic
updates off and on at run-time, this could be supported in the
DeferredUpdates class perhaps, but we already have numerous methods
there (incl db begin/commit being a good proxy already), which this
test already used, so for now I've just removed the extra assertion
for this as it wasn't essential to that test.

Bug: T228895
Bug: T238436
Change-Id: Icf29bc484c155f52b6d8f61e5902233a15ba0c6d
2021-04-27 23:35:20 +01:00
jenkins-bot
29827d736a Merge "Setup: Move LBFactory::setRequestInfo() to service wiring" 2021-04-27 05:02:13 +00:00
Timo Tijhof
d295614b38 Setup: Move LBFactory::setRequestInfo() to service wiring
Avoid costly and unconditional set up of LBFactory early on in
Setup.php. Instead, inject this information lazily if and when the
service is contructed by something that actually needs a database
connection.

This removes the cost of LBFactory service + dependencies for requests
to load.php, api.php, and rest.php requests that involve no (other)
calls to the database service.

Bug: T228895
Change-Id: I3140922cec130cad84eb89b2b34520c0988027dc
2021-04-26 22:53:56 +00:00
Ammarpad
88bfadf5ed Migrate user table to abstract schema
Postgres:
 - Rename the table from `mwuser` to `user`
 - Transition user_id from int to serial
 - Make user_token not nullable and add default
 - Make user_real_name not nullable and add default
 - Make user_email not nullable
 - Make user_newpassword not nullable
 - Make user_password not nullable
 - Drop UNIQUE contraint on user_name and add default

MySQL/SQLite:
 * No changes

Bug: T164898
Bug: T230428
Change-Id: I746714f7b3ae16f9625f97bcca84280fcd8b61a0
2021-04-24 21:44:26 +01:00
Timo Tijhof
6910c3c243 rdbms: Remove unused 'hostname' in LBFactory and LoadBalancer
One less thing to inject and pass down, one less thing where MW-specific
wiring varies from the default.

Bug: T228895
Change-Id: I1bb181a0b9b081050e544eb4b2a6c4287ee89528
2021-04-08 23:35:18 -07:00
Aaron Schulz
278bb5c23e rdbms: detect corrupt Database instances due to critical section failure
This checks that the Database state has not diverged from the driver DB
handle nor server-side connection state due to an exception being thrown
in an unexpected place within internal Database methods. DB handles with
possible state corruption will not accept queries.

For example, a PHP extension like Excimer might be used to throw request
timeout exceptions. Such exceptions can trigger after any PHP or Zend
function returns, e.g. within DatabaseMysqlBase::doSelectDomain() after
the "USE" query completes but before $this->currentDomain gets updated.

Also:
* Make getApproximateLagStatus() catch getLag() errors since begin()
  expects it to simply use "false" for the lag value on failure. This
  helps assure that $this->trxAutomatic gets properly set.
* Unsuppress exceptions in runOnTransactionPreCommitCallbacks()
  as the transaction needs to get aborted anyway (as already happens).
* Unsuppress exceptions in runOnAtomicSectionCancelCallbacks() since
  the safest thing to do is just roll back the transaction.
* Only suppress DBError exceptions in runOnTransactionIdleCallbacks().
  and runTransactionListenerCallbacks(). Return the array of errors
  rather than throw the first one. Most of the callers had to catch
  the errors, so it's easier to avoid throwing them to begin with.
* Avoid blanket try/catch in sourceStream(), doReplace(), upsert(),
  doInsertSelectGenericand().
* Clarify various code comments and add missing @internal tags.

Bug: T193565
Change-Id: I6b7b02c02b24c2ff01094af3df54c989fe504af7
2021-03-24 14:25:50 +00:00
Aaron Schulz
bd7cf4dce9 Add $wgChronologyProtectorStash and improve $wgMainStash comments
Remove WRITE_SYNC flag from ChronologyProtector since the current
plan is to simply use a datacenter-local storage cluster.

Move the touched timestamps into the same stash key that holds the
replication positions. Update the ChronologyProtector::getTouched()
comments.

Also:
* Use $wgMainCacheType as a $wgChronologyProtectorStash fallback
  since the main stash will be 'db-replicated' for most sites.
* Remove HashBagOStuff default for position store since that can
  result in timeouts waiting on a write position index to appear
  since the data does not actually persist accress requests.
* Rename ChronologyProtector::saveSessionReplicationPosition()
  since it does not actually save replication positions to storage.
* Make ChronologyProtector::getTouched() check the "enabled" field.
* Allow mocking the current time in ChronologyProtector.
* Mark some internal methods with @internal.
* Migrate various comments from $wgMainStash to BagOStuff.
* Update some other ObjectCache related comments.

Bug: T254634
Change-Id: I0456f5d40a558122a1b50baf4ab400c5cf0b623d
2021-03-01 20:34:34 +00:00
Umherirrender
8de3b7d324 Use static closures where safe to use
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.

Created by I25a17fb22b6b669e817317a0f45051ae9c608208

Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
2021-02-11 00:13:52 +00:00
C. Scott Ananian
f4301f8a64 MWLBFactory: rename magic HTTP header for opting out of sqlite write lock
It was suggested this header be renamed to be consistent with the
infrastructure header added in T91820.  We have to explicitly
allow the REST API to use this header in the WebStart sanity check.

Bug: T91820
Bug: T259685
Followup-To: b75ac3953e
Change-Id: I0c4ec63bb26641b237c92dbd3bc5367811ca0675
2021-02-04 13:24:25 -05:00
C. Scott Ananian
b75ac3953e Allow REST API POST handlers to opt out of mandatory sqlite locking
This is a follow up to T93097, which worked around a limitation of
SQLite 3.8+ which prevents it from upgrading a read transaction to a write
transaction.  Our heuristic is that HTTP POST requests are going to
eventually become DB writes, and so we take the SQLite lock early.

However, Parsoid POST requests don't have any side effects on the DB,
and taking the write lock causes deadlocks during VE saves: the POST
to action=visualeditoredit conflicts with the POST to the recursive
request to the Parsoid REST API.  We can't use a GET request for
these requests without hitting query-length limits.

This patch allows REST API calls to set the `X-MediaWiki-Read` header
to opt-out of the SQLite obligatory lock.  This avoids the deadlock,
while still allowing the API call to use a POST and avoid query length
limits.

Bug: T259685
Change-Id: If37dc890a24a45c3a914e310b5b5bf625965e9e6
2021-02-03 20:26:41 +00:00
Amir Sarabadani
c33876f834 Migrate text table to abstract schema
For MySQL/Sqlite, drop the table options, they are for MySQL < 5.0 which
was released in 2003 and not any use today.

For Postgres, rename pagecontent table to text, approved as part of the
RFC. Swap order of creating auto-generated tables and manual tables.

Bug: T230428
Bug: T164898
Change-Id: Id7510b80beed7a7297353094a57d5e2d4f12fc64
2021-01-09 16:07:54 +01:00
Aryeh Gregor
a24e8a06b5 Mark CONSTRUCTOR_OPTIONS as internal
These were never meant to be part of the public interface and should not
ever have been marked with @since. They're only useful for constructing
the respective objects, which no outside users should be doing.

Change-Id: I86e01272d46fc72af32172d8a12b9180971d4613
2020-08-21 00:18:45 -04:00
Timo Tijhof
15fa9559a9 rdbms: Simplify MWLBFactory::getLBFactoryClass
* Convert to a single map.
* Simplify source code.
* Remove deprecation warning for something we're not likely to
  remove. This was embedded into LocalSettings.php files and
  should generally just keep working and is easy and cheap to do.
  Also note clear why one half warned and the other half didn't
  (because that's the one we happen to use in prod.)
* Simplify the tests. A lot of the boilerplate was no longer needed.
* Reduce abstraction in the test as was was not more complex
  than the source it tests.

Change-Id: If3e7e25dbf3bb408581fc16ac8e556b44b1855ad
2020-06-23 17:29:38 +01:00
Tim Starling
d459add63d Introduce wfDeprecatedMsg()
Deprecating something means to say something nasty about it, or to draw
its character into question. For example, "this function is lazy and good
for nothing". Deprecatory remarks by a developer are generally taken as a
warning that violence will soon be done against the function in question.
Other developers are thus warned to avoid associating with the deprecated
function.

However, since wfDeprecated() was introduced, it has become obvious that
the targets of deprecation are not limited to functions. Developers can
deprecate literally anything: a parameter, a return value, a file
format, Mondays, the concept of being, etc. wfDeprecated() requires
every deprecatory statement to begin with "use of", leading to some
awkward sentences. For example, one might say: "Use of your mouth to
cough without it being covered by your arm is deprecated since 2020."

So, introduce wfDeprecatedMsg(), which allows deprecation messages to be
specified in plain text, with the caller description being optionally
appended. Migrate incorrect or gramatically awkward uses of wfDeprecated()
to wfDeprecatedMsg().

Change-Id: Ib3dd2fe37677d98425d0f3692db5c9e988943ae8
2020-06-22 14:34:39 +10:00
Umherirrender
4c216537df Simplify use of ?? in MWLBFactory
When the left side of ?? is wrapped with [] the array has always one
item and that means it is always true and then used

Move the use of the array key into the existing isset
The empty array for $serversCheck is the default

Change-Id: I2ec95026b3cd5a72dcaf540f369b140fd7b69a53
2020-06-18 17:17:37 +00:00
Aaron Schulz
6a8943d8c5 objectcache: dependency inject LoadBalancer into SqlBagOStuff
Clean up the recursive DB dependency mitigation logic by having
ServiceContainer detect recursion and throw an appropriate error.
Catch the error and use EmptyBagOStuff in such cases. This works
better than checking getQoS() since that begs the question by
requiring the cache instance to begin with.

Also add support for using different LoadBalancer instances for
local and global keys in SqlBagOStuff. This makes it easier to
share keys between projects.

Bug: T229062
Change-Id: Ib8ec1845bcf1b86cbb3bededa0ca7621a0ca293a
2020-05-18 21:04:17 -07:00
Tim Starling
df05164822 More flexible deprecation warnings
* Split MWDebug::sendRawDeprecated() from MWDebug::deprecated(). The new
  function can be used to send arbitrary messages to the deprecation
  log, rather than being constrained by the fixed format of
  MWDebug::deprecated().
* Split formatCallerDescription() from sendMessage() to allow the caller
  of sendRawDeprecated() to do its own caller formatting.
* Use the new function in MWLBFactory::logDeprecation()
* In tests, replace the ugly implementation of hideDeprecated() with one
  that works by setting a list of regexes to filter. hideDeprecated()
  now filters deprecation warnings that are a string match to the
  supplied function. filterDeprecated() can be used to filter a regex,
  and is intended to be used to filter warnings sent via
  sendRawDeprecated(). The filter list is reset at the start of each
  test, instead of leaking across tests as before.

Change-Id: I0d0df86db2e61cdd1769426bfa7bad4c2ae5e977
2020-04-22 12:37:22 +10:00
Holger Knust
7cc16da556 rdbms: Fix debug toolbar query tab when $wgDebugLogFile is not set
If $wgDebugLogFile was not set or empty and $wgDebugDumpSql
was set to false, the query tab would be empty.

Setting DBO_DEBUG whenever the toolbar is shown to enable query
logging.

Bug: T241516
Change-Id: I0c4f6c1a49341929b7ecad749a02c541daaa238a
2020-03-24 15:31:00 +00:00
Aaron Schulz
160370afcd rdbms: dependency inject domain aliases into LBFactory
Add new ILBFactory::setDomainAliases() method for injection database
domain aliases and call it in MWLBFactory::setDomainAliases().

Also:
* Remove overkill "last db/section" caching in LBFactoryMulti
* Clean up some LBFactoryMulti code comments
* Split out separate MWLBFactoryTest test file

Change-Id: If180a58c61178969ca7587c4a06b8786574c7254
2020-02-15 22:34:38 +00:00
mainframe98
1aa6cdab0e Remove $wgDBWindowsAuthentication
Follow up to 807d793, this setting is unused.

Bug: T230418
Change-Id: I3e27af725ec2f8f206e068f140a9cfdaafa523c7
2019-11-10 16:00:43 +01:00
jenkins-bot
4b6468ba66 Merge "rdbms: Restore debug toolbar "Queries" feature" 2019-10-15 18:29:02 +00:00
Timo Tijhof
2e404a2582 rdbms: Restore debug toolbar "Queries" feature
This broke after e0cc49ce39, due to the field 'master'
being removed from the log context. The LegacyLogger logic
forwarding these messages to MWDebug (for the debug toolbar)
however, was dependant on.

Users of debug toolbar experienced a silent failure because the
logic in question is very tolerant of missing fields. This is
because it uses those fields to distinguish the 'sql' messages
from channel=DBQuery from other messages in the same channel.
Making that less fragile is outside the scope of this commit.

This commit:

* Restore the basic functionality by making sure MWDebug::query()
  gets called again for DBQuery messages.

* Remove the code relating to the 'master' field as this no longer
  exists in RDBMS. It also wasn't used anywhere (to be used,
  it would need to be read by mediawiki.debug/debug.js).

* Remove unexpanded "{method}" and "{runtime}" noise in the debug
  toolbar text. This was introduced by he conversion to PSR-3
  logging.. These fields are already rendered separately by
  the toolbar and should not be part of the "SQL" column.
  To do this, we need to log the $sql bit as its own key, so
  I've made this a context field as well.

* Reduce the condition logic in LegacyLogger to only looking for
  'DBQuery' and 'sql'. This way, if it breaks again it will
  still call the logic within and emit E_NOTICE instead, which
  would help detect the issue (and still fallback to at least
  showing the queries). Unlike before this commit where it took
  quite some time to figure out why it wasn't working.

* The above fixes still weren't enough to get queries to show
  up in the Debug toolbar for me. Turns out, this was because
  my local setup (mediawiki-docker-dev) uses a master-replica
  set up. The setup doesn't use any custom LBFactory config,
  just plain $wgDBservers. The logic for turning these plain
  settings into LBFactory (in MWLBFactory.php) does kick in,
  and does run (unlike if I had custom wgLBFactoryConf).
  But, the DBO_DEBUG flag didn't make it through because of
  the += operator preferring any pre-existing value my setup
  has, which is just `DBO_DEFAULT`.
  Merging 'flags' keys seems unsafe in general, but adding
  DBO_DEBUG based on $wgDebugDumpSql seems innocent and doesn't
  affect other behaviour (it's a case of DWIM).

Bug: T231742
Change-Id: I122bb1a65620a7ae4e1943136c975b63524a5111
2019-10-11 20:04:05 +01:00
James D. Forrester
6898ba7232 Services: Convert MWLBFactory's static to a const now HHVM is gone
Change-Id: I2b5c77c304e03af31bc3f15f2e3f6002ca2f2647
2019-10-08 21:14:19 +00:00
Brad Jorsch
5424238aa9 Remove MySQL index aliasing for user_newtalk indexes
While these have not yet caused problems, we should probably deprecate
the whole confusing "index aliasing" feature. Cleaning this up needs to
be done first.

Method MWLBFactory::setSchemaAliases() is being considered private due
to the @internal notation, and so is being removed without deprecation.

Bug: T233240
Change-Id: Ib04b7bc4af53382fde01bd8550cc7e361124255f
2019-09-27 09:30:31 +00:00
Brad Jorsch
f45441aaa7 Clean up ar_usertext_timestamp index mess
See T233221 for the sordid history. The short version is that it might
exist as `ar_usertext_timestamp`, `usertext_timestamp`, or both on
MySQL, so dropping it for the actor migration needs to drop both names
if they exist.

We can also remove the now-obsolete aliasing from MWLBFactory.

Bug: T233221
Bug: T104756
Bug: T229712
Change-Id: I429e7ade2c86a2514aafe947012f096b03aa67ce
2019-09-18 11:49:02 -04:00
Aaron Schulz
1b57f6a81b Make ObjectCache check the value of apc.enable_cli in CLI mode
Add HashBagOStuff fallback for APC in MWLBFactory::injectObjectCaches.

Also fix APC-cache variable typo in MWLBFactory.

Bug: T227838
Change-Id: I71cb2ca58972ea09ab2f64f7e47bda7a5096c19b
2019-08-29 09:04:18 -07:00
Daimona Eaytoy
f18af0b61f Remove more Oracle and Mssql leftovers
Follows-up 4d10bb14e8 and 807d793ab9.

According to codesearch [0], these were the last usages. Note that this
patch leaves two constants in places, IDatabase::DBO_SYSDBA and
DBO_DDLMODE. These are public constants used "mostly for oracle" according
to the docs, but maybe we could find other use cases in the future (?).

[0] - https://codesearch.wmflabs.org/core/?q=oracle%7Cmssql&i=fosho&files=%5C.%5B%5Ej%5Cd%5D%7Cen%5C.json&repos=

Bug: T230418
Change-Id: Ibfb748b4b23b885a77f4de161af4bf2ab9649a89
2019-08-25 17:21:49 +00:00
Aaron Schulz
023c73f612 rdbms: normalize Database open() code and error handling
Mainly:
* Use oci_new_connect() for Oracle to avoid broken connection reuse
  similar to the PGSQL_CONNECT_FORCE_NEW flag in DatabasePostgres
* Set 'client_min_messages' unconditionally for PostgreSQL
* Factor out Database::getConnectExceptionAndLog() helper method
* Use the same style of query() calls in DatabaseOracle::open() as
  the other subclasses
* Make sure the Database driver handle field is null on failure
  instead of false for sanity

Also:
* Disallow changing of Database handle DBO_* flags after construction
  where it does not make sense to change them
* Do not mention DBO_* flags meant for non-config use in $wgDBservers
* Ignore DBO_PERSISTENT for SQLite if DBO_TRX is also set for sanity
* Remove $wgDBOracleDRCP variable to discourage careless automatic
  setting of DBO_PERSISTENT that breaks LoadBalancer assumptions

Change-Id: Iea948f7f872294ea8fc5d897fc10c9d29b7141d5
2019-07-26 15:24:28 +01:00
Aaron Schulz
237dd3f142 rdbms: fix typo and clean up some cruft in MWLBFactory
Change-Id: Ib51dfee9ed06326a8b3acfed136e75b13fc4e234
2019-07-04 18:55:19 +00:00
jenkins-bot
5ecb8b3ac6 Merge "Fix some docs" 2019-05-22 20:43:56 +00:00
Matěj Suchánek
68e8323160 Fix some docs
Discovered by phan.

Change-Id: Iadc2b151db6922f3159f061f10408d45636967c5
2019-05-22 21:50:52 +02:00
Aaron Schulz
e0cc49ce39 rdbms: improve query logging logic in Database
* Merge the two debug() calls in attemptQuery() into one single
  call which checks DBO_DEBUG. This avoids pointless SPI logger
  overhead.
* Avoid calling generalizeSQL() unless actually necessary. This
  works via a lazy-loading object.
* Make lastQuery() a bit more consistent in terms of when it
  gets updated.
* Add DBQueryDisconnectedError class for dropped connections.
* Clean up visbility and names of last query/error fields.

Change-Id: Ie8df3434d23b18f7a0f4c056d71388192cc52c6b
2019-05-08 14:58:10 -07:00
Aryeh Gregor
18ec468633 Don't pass Config to service constructors
We don't want to depend on the entire site configuration when we only
need a few specific settings.

This change additionally means that these services no longer see a live
version of the settings, but rather a copy. This means in tests you
really do have to call overrideMwServices() if you want services to pick
up your config changes.

ResourceLoader and SearchEngineConfig will need more work to port,
because they expose their member Config in a getter, and the getter is
actually used.

Parser and NamespaceInfo are also relatively complicated, so I split
them into separate patches.

Tested with 100% code coverage. \o/

Depends-On: If6534b18f6657ec1aba7327463f2661037f995b3
Change-Id: I1a3f358e8659b49de4502dc8216ecb6f35f4e02a
2019-05-02 11:33:56 +03:00
Aaron Schulz
ff181a3c4e rdbms: inject reserved word table name rewrite logic into DatabaseOracle
This works similar to that of DatabasePostgres, which uses similar rules.

Fix bogus field access in duplicateTableStructure() as well.
Also, remove a pointless wfDebug() call in DatabaseOracle.

Change-Id: Ia06ff78011dfabc17c525d7a6d2ffad98fe297de
2019-04-11 22:25:08 +00:00
Aaron Schulz
e40d52557e rdbms: inject more dependencies into DatabaseOracle and remove $wgContLang use
Instead of guessing/assuming input encodings for non-UTF8 fields,
just require that they be valid UTF-8 to begin with.

Also replace MWException use and break some long lines.

Change-Id: Ibb6f841d5d143776eca2a9d0d12cbb74f1e0d23e
2019-04-11 04:48:44 +00:00
Aaron Schulz
208d89543d rdbms: reduce code duplication and make LBFactoryMulti sanity checks work
Change-Id: I2308719b3a8fe4745c86dc7e5af0950588732ebe
2019-04-10 17:19:55 +00:00
Aaron Schulz
0136ebe603 Use HTTP method as hint for the locking mode of sqlite
Bug: T93097
Change-Id: I4aa44345e2f9e252c1a351f252bdcb9e15f180a5
2019-04-04 01:35:15 -07:00
Aaron Schulz
a8447a337b Replace several uses of wfWikiId() with WikiMap methods
Also, reword some related comments.

Change-Id: I8aefa42f96b90e9ea871cf7ec1afcc7ed82a19b2
2019-03-29 14:56:18 -07:00
Aaron Schulz
b88896d6cd Make MWLBFactory sanity check that postgres is not used with a table prefix
Change-Id: If0c75a042c0e85d4f124be2204cdd52fcd602932
2019-03-25 23:09:32 -07:00
jenkins-bot
e73b5913ea Merge "DefaultSettings: Remove deprecated $wgDBmysql5 from core" 2019-03-25 14:45:20 +00:00
Aaron Schulz
0449f653c7 Fix overzealous prefix check in MWLBFactory
Follow-up 9df277a4ba

If the server array ommitted 'tablePrefix', Database will
use '' as the prefix, so if $wgDBprefix is also '', then
no error should happen.

Change-Id: Ic207c3fceae8fd45c87f7fa24678079217a60730
2019-03-23 20:08:01 -07:00
Derick Alangi
26118ad094 DefaultSettings: Remove deprecated $wgDBmysql5 from core
This was an experimental configuration setting and was supposed
to be removed in 1.33. Also, remove option from db.

Bug: T196185
Change-Id: I357348505589ff963d668acadce3b58fe2a1b0bb
2019-03-23 14:52:33 +01:00
Aaron Schulz
9df277a4ba rdbms: halt on some common broken $wgDBServers configurations
Mention the changes, usually simple, needed to fix the problem.

Bug: T215850
Change-Id: I9911f5f5213682ffb52ac548e3082db548e37b3d
2019-03-22 08:04:48 +00:00
Aaron Schulz
b438db9e2c rdbms: change "profiler" argument in Database::factory so it works again
The Profiler::profileIn and Profiler::profileOut methods are just stubs.
Use a callback to the Profiler::scopedProfileIn method instead.

Change-Id: I16068bce583bb880250fe91235f2283453be5e4c
2019-03-14 22:19:58 +00:00
Marius Hoch
d74413bbe7 Allow passing the default DB group to use in Maintenance scripts
Also allows setting it via a global, although that is probably
less useful.

Bug: T147169
Change-Id: Ic51204a6f6ce9db4cc96108e823e388512724eff
2018-06-12 23:52:40 +02:00