http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97687
Revision: 97687
Author: asher
Date: 2011-09-21 01:08:19 +0000 (Wed, 21 Sep 2011)
Log Message:
-----------
bug 31052 : live hack to support reading from old non-slave external store
servers
Modified Paths:
--------------
branches/wmf/1.17wmf1/includes/ExternalStoreDB.php
Modified: branches/wmf/1.17wmf1/includes/ExternalStoreDB.php
===================================================================
--- branches/wmf/1.17wmf1/includes/ExternalStoreDB.php 2011-09-21 00:19:09 UTC
(rev 97686)
+++ branches/wmf/1.17wmf1/includes/ExternalStoreDB.php 2011-09-21 01:08:19 UTC
(rev 97687)
@@ -29,8 +29,18 @@
* @return DatabaseBase object
*/
function &getSlave( $cluster ) {
+ global $wgDefaultExternalStore;
+
$wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki']
: false;
$lb =& $this->getLoadBalancer( $cluster );
+
+ if ( !in_array( "DB://".$cluster, $wgDefaultExternalStore ) ) {
+ wfDebug( "read only external store" );
+ $lb->allowLagged(true);
+ } else {
+ wfDebug( "writable external store" );
+ }
+
return $lb->getConnection( DB_SLAVE, array(), $wiki );
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs