wiki.techinc.nl/includes/libs/rdbms
Tim Starling 05701ffc40 rdbms: Remove instance ownership concept
Instance ownership is supposed to protect LoadBalancer and Database
against unauthorized calls to internal methods other than by the owning
LoadBalancer/LBFactory. This seems like unnecessary complexity. It was
introduced for T231443 and T217819, but the link was speculative and in
the end it didn't help to fix or isolate those bugs. Since then it has
caused a production error (T303885) and an intermittent CI failure
(T292239).

Instead, split the ILoadBalancer interface, introducing
ILoadBalancerForOwner, which contains the methods which are only safe
to call by LBFactory or by the caller of LBFactory::newMainLB(). This
allows phan to statically detect inappropriate calls to internal
methods.

Ownership was used for convenience for two things unrelated to its
original purpose:

* Suppressing calls to ScopedCallback::newScopedIgnoreUserAbort() when
  the caller has already called it. But nested calls are apparently
  harmless, so I just called it unconditionally.
* Suppressing exceptions from Database::close(). I extended the
  behaviour for owned instances to apply to all instances, so even
  unowned instances will no longer throw on close.

CodeSearch suggests nothing in extensions is calling these methods with
an owner parameter. One extension (Wikibase) overrides a method with an
owner parameter in a test mock class and so needs to be simultaneously
updated.

Depends-On: Ib03aba9d8f5f05b875a321d00b14483633a636a8
Change-Id: I27ba4973d24d759c88b3868c95e7db875801ca0c
2022-04-26 11:48:46 +10:00
..
connectionmanager rdbms: Hard-deprecate LoadBalancer::getLazyConnectionRef 2022-03-09 10:45:00 +01:00
database rdbms: Remove instance ownership concept 2022-04-26 11:48:46 +10:00
dbal MWMySQLPlatformCompat.php: Fix leading whitespace 2022-01-04 23:45:00 +00:00
encasing
exception rdmbs: Start of SQLPlatform to split out of Database 2022-04-24 16:07:44 +00:00
field Replace remaining usages of IDatabase::fetchObject() 2022-01-19 01:42:16 +01:00
lbfactory rdbms: Remove instance ownership concept 2022-04-26 11:48:46 +10:00
loadbalancer rdbms: Remove instance ownership concept 2022-04-26 11:48:46 +10:00
loadmonitor Replace remaining usages of IDatabase::fetchObject() 2022-01-19 01:42:16 +01:00
platform rdmbs: Start of SQLPlatform to split out of Database 2022-04-24 16:07:44 +00:00
querybuilder Add per-table straight join option 2022-01-07 13:26:25 +11:00
ChronologyProtector.php Fix typos in comments (C-D) 2021-12-30 18:00:02 +05:30
defines.php Replace uses of DB_MASTER with DB_PRIMARY 2021-04-29 09:24:31 -07:00
TransactionProfiler.php rdbms: Add DB host to TransactionProfiler logging and fix time fields 2021-11-29 16:14:04 +00:00