Commit graph

3 commits

Author SHA1 Message Date
Kunal Mehta
499a1fe497 rdbms: Move Database::factory() to DatabaseFactory service
We also bring along Database::attributesFromType(), which relied on the
private ::getClass(). This requires us to inject DatabaseFactory through
the LBFactory/LoadBalancer hierarchy.

Database::factory() is now soft deprecated. All callers outside of
includes/installer/ still need migration.

Bug: T299691
Bug: T315270
Change-Id: I7d057a9438f1b097554679975e4e9b2fc99e7c2b
2022-08-31 10:53:50 +10:00
daniel
5b0b54599b Allow DB config to be reloaded on the fly
This introduces $wgLBFactoryConf['configCallback'] which can be set to a
function that returns updates to be applied to $wgLBFactoryConf. The new
method LBFactory::autoreConfigure() can be called to check the callabck
and, if the config changed, reconfigure all existing LoadBalancers.

Reconfiguring the LoadBalancers causes all open connections to be
invalidated; however, any DBConnRef instances will remain valid and will
acquire a fresh connection from the LoadBalancer automatically when
appropriate.

As a proof of concept, this patch adds support for config reloding
into WikiExporter.

Bug: T298485
Change-Id: I6c3ffde62f6e038730736abe980befd90ec43e1a
2022-08-05 17:32:12 +02:00
DannyS712
7c6fbecf34 Convert MWLBFactoryTest to pure unit tests
No integration needed, remove `@group Database` tag

Change-Id: I2743ac252445cc4f5e2fe58939e81270a6a6525a
2021-04-14 16:48:30 +00:00
Renamed from tests/phpunit/includes/db/MWLBFactoryTest.php (Browse further)