MediaWiki uses a database abstraction layer, via the Wikimedia\Rdbms\Database class, as documented here: https://www.mediawiki.org/wiki/Manual:Database_access#Database_Abstraction_Layer
Wikimedia production sites use a primary database and replica databases. For performance reasons, read queries use the replica databases. By convention, for instances of the Database class performing read queries, the variable $dbr is used (as opposed to $dbw for write queries).
The Special:Investigate feature uses the variable name $db in several places, where $dbr should be used instead.
Affected classes: TimelineRowFormatter, CompareService, PreliminaryCheckService.
Acceptance criteria
- In the affected classes, where the replicas are being read, change the variable name from $db to $dbr.