Volans has submitted this change and it was merged.

Change subject: MariaDB: set $master true for codfw masters
......................................................................


MariaDB: set $master true for codfw masters

- Allow to set $master = true for all master regardless of the
  datacenter in which they are.
- Start pt-heartbeat only for masters in the $::mw_primary datacenter.

Bug: T134481
Change-Id: Ic9d0de49c008f4fa740714baaf51b7a96ff6396d
---
M manifests/role/mariadb.pp
M manifests/site.pp
2 files changed, 39 insertions(+), 15 deletions(-)

Approvals:
  Jcrespo: Looks good to me, but someone else must approve
  Volans: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp
index 6cb2344..9b6035e 100644
--- a/manifests/role/mariadb.pp
+++ b/manifests/role/mariadb.pp
@@ -131,6 +131,7 @@
         shard => $shard,
     }
 
+    # TODO: move pt-heartbeat outside of the actual master
     class { 'mariadb::heartbeat':
         shard   => $shard,
         enabled => $master,
@@ -206,6 +207,7 @@
         include coredb_mysql::snapshot
     }
 
+    # TODO: move pt-heartbeat outside of the actual master
     class { 'mariadb::heartbeat':
         shard   => $shard,
         enabled => $master,
@@ -219,7 +221,7 @@
     }
 }
 
-# Eventlogging needs tobe sandboxed by itself. It can consume resources
+# Eventlogging needs to be sandboxed by itself. It can consume resources
 # unpredictably, especially during backfilling. It also benefits greatly
 # from a setup tuned for TokuDB.
 class role::mariadb::misc::eventlogging(
@@ -261,6 +263,7 @@
         shard => $shard,
     }
 
+    # TODO: move pt-heartbeat outside of the actual master
     class { 'mariadb::heartbeat':
         shard   => $shard,
         enabled => $master,
@@ -508,7 +511,6 @@
     include passwords::misc::scripts
     include role::mariadb::ferm
 
-    # N.B.: NON $::mw_primary masters are considered slaves for now
     if ($shard == 'es1') {
         $mysql_role = 'standalone'
     } elsif $master == true {
@@ -551,6 +553,7 @@
         $semi_sync = 'slave'
     }
 
+    # Read only forced on also for the masters of the primary datacenter
     class { 'mariadb::config':
         prompt        => "PRODUCTION ${shard}",
         config        => $config,
@@ -569,9 +572,10 @@
         contact_group => 'admins', # only show on nagios/irc
     }
 
+    $heartbeat_enabled = $master and ($::mw_primary == $::site)
     class { 'mariadb::heartbeat':
         shard   => $shard,
-        enabled => $master,
+        enabled => $heartbeat_enabled,
     }
 }
 
diff --git a/manifests/site.pp b/manifests/site.pp
index 2720a99..a1ceb92 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -447,7 +447,7 @@
 node 'db2016.codfw.wmnet' {
     class { 'role::mariadb::core':
         shard         => 's1',
-        master        => false,
+        master        => true,
         p_s           => 'on',
         binlog_format => 'STATEMENT',
         ssl           => 'puppet-cert',
@@ -492,7 +492,7 @@
 node 'db2017.codfw.wmnet' {
     class { 'role::mariadb::core':
         shard         => 's2',
-        master        => false,
+        master        => true,
         p_s           => 'on',
         binlog_format => 'STATEMENT',
         ssl           => 'multiple-ca',
@@ -538,7 +538,7 @@
 node 'db2018.codfw.wmnet' {
     class { 'role::mariadb::core':
         shard         => 's3',
-        master        => false,
+        master        => true,
         p_s           => 'on',
         binlog_format => 'STATEMENT',
         ssl           => 'puppet-cert',
@@ -583,7 +583,7 @@
 node 'db2019.codfw.wmnet' {
     class { 'role::mariadb::core':
         shard         => 's4',
-        master        => false,
+        master        => true,
         p_s           => 'on',
         binlog_format => 'STATEMENT',
         ssl           => 'puppet-cert',
@@ -628,7 +628,7 @@
 node 'db2023.codfw.wmnet' {
     class { 'role::mariadb::core':
         shard         => 's5',
-        master        => false,
+        master        => true,
         p_s           => 'on',
         binlog_format => 'STATEMENT',
         ssl           => 'puppet-cert',
@@ -673,7 +673,7 @@
 node 'db2028.codfw.wmnet' {
     class { 'role::mariadb::core':
         shard         => 's6',
-        master        => false,
+        master        => true,
         p_s           => 'on',
         binlog_format => 'STATEMENT',
         ssl           => 'puppet-cert',
@@ -718,7 +718,7 @@
 node 'db2029.codfw.wmnet' {
     class { 'role::mariadb::core':
         shard         => 's7',
-        master        => false,
+        master        => true,
         p_s           => 'on',
         binlog_format => 'STATEMENT',
         ssl           => 'puppet-cert',
@@ -754,10 +754,10 @@
 }
 
 # codfw
-node 'db2009.codfw.wmnet' {
+node 'db2033.codfw.wmnet' {
     class { 'role::mariadb::core':
         shard         => 'x1',
-        master        => false,
+        master        => true,
         p_s           => 'on',
         binlog_format => 'ROW',
         ssl           => 'puppet-cert',
@@ -765,7 +765,7 @@
     include base::firewall
 }
 
-node /^db20(08|33)\.codfw\.wmnet/ {
+node /^db20(08|09)\.codfw\.wmnet/ {
     class { 'role::mariadb::core':
         shard         => 'x1',
         p_s           => 'on',
@@ -1034,7 +1034,17 @@
 }
 
 ## codfw servers
-node /es201[456]\.codfw\.wmnet/ {
+node 'es2015.codfw.wmnet' {
+    class { 'role::mariadb::core':
+        shard         => 'es2',
+        master        => true,
+        p_s           => 'on',
+        binlog_format => 'ROW',
+    }
+    include base::firewall
+}
+
+node /es201[46]\.codfw\.wmnet/ {
     class { 'role::mariadb::core':
         shard         => 'es2',
         p_s           => 'on',
@@ -1066,7 +1076,17 @@
 }
 
 ## codfw servers
-node /es201[789]\.codfw\.wmnet/ {
+node 'es2018.codfw.wmnet' {
+    class { 'role::mariadb::core':
+        shard         => 'es3',
+        master        => true,
+        p_s           => 'on',
+        binlog_format => 'ROW',
+    }
+    include base::firewall
+}
+
+node /es201[79]\.codfw\.wmnet/ {
     class { 'role::mariadb::core':
         shard         => 'es3',
         p_s           => 'on',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic9d0de49c008f4fa740714baaf51b7a96ff6396d
Gerrit-PatchSet: 7
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Volans <[email protected]>
Gerrit-Reviewer: Jcrespo <[email protected]>
Gerrit-Reviewer: Volans <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to