Make DB handles inherit configured read-only mode
LBFactory inherits $wgReadOnly, the LBs inherit
any LBFactory read only mode, and Database objects
inherit any LB read-only mode.
Add some methods callers can use to check if
a DB/LB handle is read-only before trying writes.
Additionally:
* Fix
5ec1e47475 regression where readOnlyBySection
read-only mode would not affect wfReadOnly() but only
lagged-slave read-only mode for LBFactoryMulti.
* Catch errors when getLaggedSlaveMode() is called after
master connection and object is established.
* Make getLaggedSlaveMode() a no-op if there are no slaves.
* Make string/false logic for read-only consistent everywhere.
* Remove mLaggedSlaveMode "m" prefix.
Change-Id: Ice3224caae564aa5ffb41b424c23d1593229117a