jenkins-bot has submitted this change and it was merged.

Change subject: Reduce poolcounter configuration complexity
......................................................................


Reduce poolcounter configuration complexity

Bug: T114273
Change-Id: I6a4f49c7ebf0227d95c9fc00e1bf65687bb54ab0
---
M tests/TestServices.php
M wmf-config/CommonSettings.php
M wmf-config/LabsServices.php
D wmf-config/PoolCounterSettings-codfw.php
D wmf-config/PoolCounterSettings-eqiad.php
D wmf-config/PoolCounterSettings-labs.php
R wmf-config/PoolCounterSettings.php
M wmf-config/ProductionServices.php
8 files changed, 29 insertions(+), 42 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, but someone else must approve
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/TestServices.php b/tests/TestServices.php
index 66ad076..991e74d 100644
--- a/tests/TestServices.php
+++ b/tests/TestServices.php
@@ -2,8 +2,8 @@
 # WARNING: This file is publically viewable on the web. Do not put private 
data here.
 
 #######################################################################
-# ProductionServices.php should include all the service hostnames/ips
-# for any service used in production, divided by datacenter.
+# TestServices.php should include all the service hostnames/ips
+# for any service referenced in unittests, divided by datacenter.
 #
 # It is included by CommonSettings.php
 #
@@ -41,7 +41,7 @@
 $wmfAllServices['unittest']['poolcounter'] = array( '127.0.0.1' );
 
 ### LockManager Redis
-$wmfAllServices['eqiad']['redis_lock'] = array(
+$wmfAllServices['unittest']['redis_lock'] = array(
        'rdb1' => '127.0.0.1',
        'rdb2' => '127.0.0.1',
        'rdb3' => '127.0.0.1'
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index a843034..e9dd255 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -825,8 +825,7 @@
 
 // PoolCounter
 if ( $wmgUsePoolCounter ) {
-       # Cluster-dependent files for poolcounter are included from the common 
file
-       include( "$wmfConfigDir/PoolCounterSettings-common.php" );
+       include( "$wmfConfigDir/PoolCounterSettings.php" );
 }
 
 if ( $wmgUseScore ) {
diff --git a/wmf-config/LabsServices.php b/wmf-config/LabsServices.php
index d27776c..6bf5e0e 100644
--- a/wmf-config/LabsServices.php
+++ b/wmf-config/LabsServices.php
@@ -43,6 +43,12 @@
 ### Restbase
 $wmfAllServices['eqiad']['restbase'] = 'http://10.68.17.189:7231'; // 
deployment-restbase02.deployment-prep.eqiad.wmflabs
 
+### Poolcounter
+$wmfAllServices['eqiad']['poolcounter'] = array(
+       '10.68.19.181', # deployment-poolcounter01.deployment-prep.eqiad.wmflabs
+);
+
+
 # Shorthand when we have no master-slave situation to keep into account
 $wmfLocalServices = $wmfAllServices[$wmfDatacenter];
 
diff --git a/wmf-config/PoolCounterSettings-codfw.php 
b/wmf-config/PoolCounterSettings-codfw.php
deleted file mode 100644
index 88704a6..0000000
--- a/wmf-config/PoolCounterSettings-codfw.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-# For now using eqiad PC servers
-$wgPoolCountClientConf = array(
-       'servers' => array(
-               '10.192.16.124',
-               '10.192.0.121'
-       ),
-       'timeout' => 0.5,
-       'connect_timeout' => 0.01,
-);
diff --git a/wmf-config/PoolCounterSettings-eqiad.php 
b/wmf-config/PoolCounterSettings-eqiad.php
deleted file mode 100644
index 2d698f2..0000000
--- a/wmf-config/PoolCounterSettings-eqiad.php
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-$wgPoolCountClientConf = array(
-       'servers' => array(
-               '10.64.0.179',
-               '10.64.16.152'
-       ),
-       'timeout' => 0.5
-);
-
-# Enable connect_timeout for testwiki
-if ($wgDBname == 'testwiki' ) {
-       $wgPoolCountClientConf['connect_timeout'] = 0.01;
-}
diff --git a/wmf-config/PoolCounterSettings-labs.php 
b/wmf-config/PoolCounterSettings-labs.php
deleted file mode 100644
index 8d940eb..0000000
--- a/wmf-config/PoolCounterSettings-labs.php
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-
-$wgPoolCountClientConf = array(
-       'servers' => array(
-               '10.68.19.181', # 
deployment-poolcounter01.deployment-prep.eqiad.wmflabs
-       ),
-       'timeout' => 0.5,
-       'connect_timeout' => 0.01 # Connect timeout is 10 ms
-);
diff --git a/wmf-config/PoolCounterSettings-common.php 
b/wmf-config/PoolCounterSettings.php
similarity index 85%
rename from wmf-config/PoolCounterSettings-common.php
rename to wmf-config/PoolCounterSettings.php
index c7f4f7e..e8586fc 100644
--- a/wmf-config/PoolCounterSettings-common.php
+++ b/wmf-config/PoolCounterSettings.php
@@ -71,6 +71,12 @@
        );
 }
 
-require $wmfRealm === 'labs'
-       ? "{$wmfConfigDir}/PoolCounterSettings-labs.php"
-       : "{$wmfConfigDir}/PoolCounterSettings-{$wmfDatacenter}.php";
+$wgPoolCountClientConf = array(
+       'servers' => $wmfLocalServices['poolcounter'],
+       'timeout' => 0.5
+);
+
+# Enable connect_timeout for testwiki
+if ( $wgDBname == 'testwiki' || $wmfDatacenter == 'codfw' || $wmfRealm == 
'labs' ) {
+       $wgPoolCountClientConf['connect_timeout'] = 0.01;
+}
diff --git a/wmf-config/ProductionServices.php 
b/wmf-config/ProductionServices.php
index 3aed824..40729c9 100644
--- a/wmf-config/ProductionServices.php
+++ b/wmf-config/ProductionServices.php
@@ -61,6 +61,16 @@
 $wmfAllServices['eqiad']['restbase'] = 'http://10.2.2.17:7231';
 $wmfAllServices['codfw']['restbase'] = 'http://10.2.2.17:7231';
 
+### Poolcounter
+$wmfAllServices['eqiad']['poolcounter'] = array(
+       '10.64.0.179', # helium.eqiad.wmnet
+       '10.64.16.152', # potassium.eqiad.wmnet
+);
+$wmfAllServices['codfw']['poolcounter'] = array(
+       '10.192.16.124', # subra.codfw.wmnet
+       '10.192.0.121', # suhail.codfw.wmnet
+);
+
 # Shorthand when we have no master-slave situation to keep into account
 $wmfLocalServices = $wmfAllServices[$wmfDatacenter];
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a4f49c7ebf0227d95c9fc00e1bf65687bb54ab0
Gerrit-PatchSet: 8
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to