From: Aaron Schulz Date: Thu, 6 Jul 2017 21:13:01 +0000 (-0700) Subject: objectcache: Use a separate postgres connection in SqlBagOStuff X-Git-Tag: 1.31.0-rc.0~2778^2 X-Git-Url: http://git.cyclocoop.org/%27-%20%20.%20url_absolue%28find_in_path%28%27spip_style.css%27%29%29%20%20%20.%20url_absolue%28find_in_path%28%27prive/spip_style.css%27%29%29%20.%20%27?a=commitdiff_plain;h=f24b3899e383829cce6808cd527fff7222e685c9;p=lhc%2Fweb%2Fwiklou.git objectcache: Use a separate postgres connection in SqlBagOStuff The flags to the driver use new connections for new LBs since fda4d46fc4f810. This makes it consistent with what we do for MySQL already. This should fix warnings about TransactionProfiler in objectcache, as well as warnings about "Pending writes" in WANObjectCache. Bug: T167946 Bug: T154424 Change-Id: I0b0d9a7210b6a3270d32df778fcc4b9918d3dcd1 --- diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 6c103017d0..70795eccd9 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -148,7 +148,7 @@ class SqlBagOStuff extends BagOStuff { protected function getSeparateMainLB() { global $wgDBtype; - if ( $wgDBtype === 'mysql' && $this->usesMainDB() ) { + if ( $this->usesMainDB() && $wgDBtype !== 'sqlite' ) { if ( !$this->separateMainLB ) { // We must keep a separate connection to MySQL in order to avoid deadlocks $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); @@ -156,8 +156,7 @@ class SqlBagOStuff extends BagOStuff { } return $this->separateMainLB; } else { - // However, SQLite has an opposite behavior. And PostgreSQL needs to know - // if we are in transaction or not (@TODO: find some PostgreSQL work-around). + // However, SQLite has an opposite behavior due to DB-level locking return null; } }