From df6100e0cc069451913479483f3773532a60ffae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jes=C3=BAs=20Mart=C3=ADnez=20Novo?= Date: Mon, 22 Apr 2019 11:21:52 +0200 Subject: [PATCH] ExternalStore: Pass external domain to getReadOnlyReason Be consistent with other paths of code that supply the external domain id to LoadBalancer instead of defaulting to the wiki's domain. This was causing the getReadOnlyReason to fail because it tries to connect to the local wiki database using external storage credentials. Bug: T200471 Change-Id: Ie73ea931d5c93f967624ee67717f87c2d9a31559 --- includes/externalstore/ExternalStoreDB.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/externalstore/ExternalStoreDB.php b/includes/externalstore/ExternalStoreDB.php index 4164505822..cac16b6a90 100644 --- a/includes/externalstore/ExternalStoreDB.php +++ b/includes/externalstore/ExternalStoreDB.php @@ -106,7 +106,9 @@ class ExternalStoreDB extends ExternalStoreMedium { } public function isReadOnly( $location ) { - return ( $this->getLoadBalancer( $location )->getReadOnlyReason() !== false ); + $lb = $this->getLoadBalancer( $location ); + $domainId = $this->getDomainId( $lb->getServerInfo( $lb->getWriterIndex() ) ); + return ( $lb->getReadOnlyReason( $domainId ) !== false ); } /** -- 2.20.1