rdbms: expand on LoadBalancer ownership concept
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 29 Aug 2019 04:05:10 +0000 (21:05 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 5 Sep 2019 19:08:13 +0000 (12:08 -0700)
commit1fbb16c712b259e77c78357a7a89b2f8342287fc
treeb4911dd98763305d8d2296f4c1cf611286903830
parentad0f69d1694df98bb36b919ce967ff62f9322c1a
rdbms: expand on LoadBalancer ownership concept

Enforce this pattern for the remaining LoadBalancer methods.
Carry this over into Database::close() to decide how loud the
error handling should be.

In LBFactory, clean up ownership of newMainLB()/newExternalLB().
The should have a null owner if called from outside the class
since the LBFactory does not track nor care about them anymore
in that case. Disable newMainLB() for LBFactorySingle as it
makes no sense and was broken.

Also remove some redundant abstract LBFactory methods that
just duplciate ILBFactory.

Bug: T231443
Bug: T217819
Depends-On: I7ed5c799320430c196a9a8e81af901999e2de7d0
Change-Id: I90b30a79754cfcc290277d302052e60df4fbc649
12 files changed:
includes/libs/rdbms/database/DBConnRef.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/IDatabase.php
includes/libs/rdbms/lbfactory/ILBFactory.php
includes/libs/rdbms/lbfactory/LBFactory.php
includes/libs/rdbms/lbfactory/LBFactoryMulti.php
includes/libs/rdbms/lbfactory/LBFactorySimple.php
includes/libs/rdbms/lbfactory/LBFactorySingle.php
includes/libs/rdbms/loadbalancer/ILoadBalancer.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php
tests/phpunit/includes/db/LBFactoryTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php