From e92cefafdf70b380a0882b2fbe3250860769c986 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 30 Aug 2016 15:32:09 -0700 Subject: [PATCH] objectcache: Make SqlBagOStuff::waitForSlaves() no-op without slaves Change-Id: Ibaa4745c18c6f4f66edb4c5f190196b575d3b738 --- includes/objectcache/SqlBagOStuff.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 7a89991679..73f8280d32 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -801,6 +801,10 @@ class SqlBagOStuff extends BagOStuff { if ( $this->usesMainDB() ) { $lb = $this->getSeparateMainLB() ?: MediaWikiServices::getInstance()->getDBLoadBalancer(); + // Return if there are no slaves + if ( $lb->getServerCount() <= 1 ) { + return true; + } // Main LB is used; wait for any slaves to catch up try { $pos = $lb->getMasterPos(); -- 2.20.1