From 884462848793e58b65e5c7a778d6fa90ecbb6b5e Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 15 Jan 2005 10:11:45 +0000 Subject: [PATCH] Minor load balancing improvements --- includes/DefaultSettings.php | 3 +++ includes/Setup.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 5943dd049e..72df355e78 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -262,6 +262,9 @@ $wgSharedDB = null; # Leave at false to use the single-server variables above $wgDBservers = false; +# How long to wait for a slave to catch up to the master +$wgMasterWaitTimeout = 10; + # Sysop SQL queries # The sql user shouldn't have too many rights other the database, restrict # it to SELECT only on 'cur' table for example diff --git a/includes/Setup.php b/includes/Setup.php index 33a4ea7830..e31aceb7fc 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -92,7 +92,7 @@ global $wgMsgCacheExpiry, $wgCommandLineMode; global $wgBlockCache, $wgParserCache, $wgParser, $wgMsgParserOptions; global $wgLoadBalancer, $wgDBservers, $wgDebugDumpSql; global $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, $wgDBtype; -global $wgUseOldExistenceCheck, $wgEnablePersistentLC; +global $wgUseOldExistenceCheck, $wgEnablePersistentLC, $wgMasterWaitTimeout; global $wgFullyInitialised; @@ -204,7 +204,7 @@ if ( !$wgDBservers ) { 'flags' => ($wgDebugDumpSql ? DBO_DEBUG : 0) | DBO_DEFAULT )); } -$wgLoadBalancer = LoadBalancer::newFromParams( $wgDBservers ); +$wgLoadBalancer = LoadBalancer::newFromParams( $wgDBservers, false, $wgMasterWaitTimeout ); $wgLoadBalancer->loadMasterPos(); wfProfileOut( $fname.'-database' ); -- 2.20.1