[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_29]: objectcache: Use a separate postgres connection in SqlBagOStuff

2017-07-07 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363995 )

Change subject: objectcache: Use a separate postgres connection in SqlBagOStuff
..


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
(cherry picked from commit f24b3899e383829cce6808cd527fff7222e685c9)
---
M includes/objectcache/SqlBagOStuff.php
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/objectcache/SqlBagOStuff.php 
b/includes/objectcache/SqlBagOStuff.php
index a4a6ba8..19e0c6c 100644
--- a/includes/objectcache/SqlBagOStuff.php
+++ b/includes/objectcache/SqlBagOStuff.php
@@ -148,7 +148,7 @@
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 @@
}
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;
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/363995
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b0d9a7210b6a3270d32df778fcc4b9918d3dcd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_29
Gerrit-Owner: Chad 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_29]: objectcache: Use a separate postgres connection in SqlBagOStuff

2017-07-07 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/363995 )

Change subject: objectcache: Use a separate postgres connection in SqlBagOStuff
..

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
(cherry picked from commit f24b3899e383829cce6808cd527fff7222e685c9)
---
M includes/objectcache/SqlBagOStuff.php
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/95/363995/1

diff --git a/includes/objectcache/SqlBagOStuff.php 
b/includes/objectcache/SqlBagOStuff.php
index a4a6ba8..19e0c6c 100644
--- a/includes/objectcache/SqlBagOStuff.php
+++ b/includes/objectcache/SqlBagOStuff.php
@@ -148,7 +148,7 @@
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 @@
}
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;
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/363995
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b0d9a7210b6a3270d32df778fcc4b9918d3dcd1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_29
Gerrit-Owner: Chad 
Gerrit-Reviewer: Aaron Schulz 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits