externalstore: unbreak writes to non-default storage clusters due to isReadOnly()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 17 Jul 2019 04:52:32 +0000 (21:52 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 17 Jul 2019 05:08:00 +0000 (22:08 -0700)
commit4f76b9543a8cec4358cfa15301d0bda38f1b4f26
tree7f8e06db935d227de017e04cac8723c608d6b541
parent5c771bda882791647922d00d39bf95b60bdad9ae
externalstore: unbreak writes to non-default storage clusters due to isReadOnly()

Instead of telling ExternalStoreMedium classes the default write stores and using
that to make them read-only, let them be configured via other means. For example,
ExternalStoreMwstore already respects FileBackend::isReadOnly() for each location
(e.g. file backends) and ExternalStoreDB checks LoadBalancer::getReadOnlyMode()
for each location (e.g. DB cluster).

Make ExternalStoreAccess::isReadOnly() take a list of base URLs, default to the
default write stores if not specified.

Bug: T227156
Change-Id: I3161890fb2ccb46d6206628f0cd88f8af9f1688c
Follows-Up: I40c3b5534fc8a31116c4c5eb64ee6e4903a6197a
includes/externalstore/ExternalStoreAccess.php
includes/externalstore/ExternalStoreDB.php
includes/externalstore/ExternalStoreFactory.php
includes/externalstore/ExternalStoreMedium.php
tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php