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

Change subject: Switched to pt-heartbeat lag detection on s6
......................................................................


Switched to pt-heartbeat lag detection on s6

Bug: T111266
Change-Id: I21f39be9d0fed0fad0af877cfeb5794dad732b6a
---
M tests/dbconfigTest.php
M wmf-config/db-codfw.php
M wmf-config/db-eqiad.php
3 files changed, 101 insertions(+), 12 deletions(-)

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



diff --git a/tests/dbconfigTest.php b/tests/dbconfigTest.php
index d733018..7018074 100644
--- a/tests/dbconfigTest.php
+++ b/tests/dbconfigTest.php
@@ -14,17 +14,21 @@
 
        public static function provideRealmDatacenter() {
                return array(
-                       array( 'production', 'eqiad' ),
-                       array( 'production', 'codfw' ),
-                       array( 'labs', 'eqiad' ),
+                       array( 'production', 'eqiad', 'eqiad' ),
+                       array( 'production', 'eqiad', 'codfw' ),
+                       array( 'production', 'codfw', 'eqiad' ),
+                       array( 'production', 'codfw', 'codfw' ),
+                       array( 'labs', 'eqiad', 'eqiad' ),
                );
        }
 
-       function loadDbFile( $realm, $datacenter ) {
-               global $wmfRealm, $wmfDatacenter;
+       function loadDbFile( $realm, $datacenter, $masterdatacenter ) {
+               global $wmfRealm, $wmfDatacenter, $wmfMasterDatacenter;
 
-               list( $oldRealm, $oldDatacenter ) = array( $wmfRealm, 
$wmfDatacenter );
-               list( $wmfRealm, $wmfDatacenter ) = array( $realm, $datacenter 
);
+               list( $oldRealm, $oldDatacenter, $oldMasterDatacenter ) =
+                       array( $wmfRealm, $wmfDatacenter, $wmfMasterDatacenter 
);
+               list( $wmfRealm, $wmfDatacenter, $wmfMasterDatacenter ) =
+                       array( $realm, $datacenter, $masterdatacenter );
 
                # "properly" load db.php in local context:
                $wgDBname     = 'testwiki';
@@ -36,7 +40,8 @@
 
                include( getRealmSpecificFilename( __DIR__ . 
'/../wmf-config/db.php' ) );
 
-               list( $wmfRealm, $wmfDatacenter ) = array( $oldRealm, 
$oldDatacenter );
+               list( $wmfRealm, $wmfDatacenter, $wmfMasterDatacenter ) =
+                       array( $oldRealm, $oldDatacenter, $oldMasterDatacenter 
);
 
                return $wgLBFactoryConf;
        }
@@ -46,9 +51,9 @@
         *
         * @dataProvider provideRealmDatacenter
         */
-       function testSectionLoadsInHostsbyname( $realm, $datacenter ) {
+       function testSectionLoadsInHostsbyname( $realm, $datacenter, 
$masterdatacenter ) {
                $ok = true;
-               $lb = $this->loadDbFile( $realm, $datacenter );
+               $lb = $this->loadDbFile( $realm, $datacenter, $masterdatacenter 
);
                foreach ( $lb['sectionLoads'] as $clusterName => $cluster ) {
                        foreach ( $cluster as $host => $weight ) {
                                if ( !array_key_exists( $host, 
$lb['hostsByName'] ) ) {
@@ -69,9 +74,9 @@
         *
         * @dataProvider provideRealmDatacenter
         */
-       function testDbAssignedToAnExistingCluster( $realm, $datacenter ) {
+       function testDbAssignedToAnExistingCluster( $realm, $datacenter, 
$masterdatacenter ) {
                $ok = true;
-               $lb = $this->loadDbFile( $realm, $datacenter );
+               $lb = $this->loadDbFile( $realm, $datacenter, $masterdatacenter 
);
                foreach ( $lb['sectionsByDB'] as $dbname => $cluster) {
                        if ( !array_key_exists( $cluster, $lb['sectionLoads'] ) 
) {
                                $ok = false;
diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php
index 151a5a7..6023b18 100644
--- a/wmf-config/db-codfw.php
+++ b/wmf-config/db-codfw.php
@@ -170,6 +170,48 @@
        ]
 ],
 
+'templateOverridesBySection' => [
+       /*
+       's1' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's1', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       's2' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's2', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       'DEFAULT' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's3', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       's4' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's4', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ),
+       's5' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's5', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       */
+       's6' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's6', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       /*
+       's7' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's7', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       */
+],
+
 'groupLoadsBySection' => [
        's1' => [
                'watchlist' => [
diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 2720e80..4ac7ab7 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -192,6 +192,48 @@
        ]
 ],
 
+'templateOverridesBySection' => [
+       /*
+       's1' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's1', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       's2' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's2', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       'DEFAULT' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's3', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       's4' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's4', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ),
+       's5' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's5', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       */
+       's6' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's6', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       /*
+       's7' => [
+               'lagDetectionMethod' => 'pt-heartbeat',
+               'lagDetectionOptions' => [
+                       'conds' => [ 'shard' => 's7', 'datacenter' => 
$wmfMasterDatacenter ] ],
+       ],
+       */
+],
+
 'groupLoadsBySection' => [
        's1' => [
                'watchlist' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I21f39be9d0fed0fad0af877cfeb5794dad732b6a
Gerrit-PatchSet: 13
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: ArielGlenn <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: Jcrespo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to