Puppet Class: profile::mariadb::parsercache

Defined in:
modules/profile/manifests/mariadb/parsercache.pp

Overview

Parameters:

  • shard (Any) (defaults to: lookup('mariadb::parsercache::shard'))
  • wikiuser_username (Any) (defaults to: lookup('profile::mariadb::wikiuser_username'))


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'modules/profile/manifests/mariadb/parsercache.pp', line 4

class profile::mariadb::parsercache (
    $shard = lookup('mariadb::parsercache::shard'),
    $wikiuser_username = lookup('profile::mariadb::wikiuser_username')
) {
    $mw_primary = mediawiki::state('primary_dc')

    include ::profile::mariadb::mysql_role
    profile::mariadb::section { $shard: }

    $mysql_role = $profile::mariadb::mysql_role::role
    $is_master = $mysql_role == 'master'
    $is_writeable_dc = profile::mariadb::section_params::is_writeable_dc($shard)
    $is_primary_master = $is_master and $is_writeable_dc

    include ::passwords::misc::scripts
    include ::profile::mariadb::monitor::prometheus

    require profile::mariadb::packages_wmf
    include profile::mariadb::wmfmariadbpy
    class { 'mariadb::service': }

    profile::mariadb::grants::core { $shard:
        wikiadmin_pass    => $passwords::misc::scripts::wikiadmin_pass,
        wikiuser_username => $wikiuser_username,
        wikiuser_pass     => $passwords::misc::scripts::wikiuser_pass,
    }
    class { 'profile::mariadb::grants::production':
        shard    => 'parsercache',
        prompt   => 'PARSERCACHE',
        password => $passwords::misc::scripts::mysql_root_pass,
    }

    class { 'mariadb::config':
        config  => 'role/mariadb/mysqld_config/parsercache.my.cnf.erb',
        datadir => '/srv/sqldata-cache',
        tmpdir  => '/srv/tmp',
        ssl     => 'puppet-cert',
        p_s     => 'on',
        basedir => $profile::mariadb::packages_wmf::basedir,
    }

    class { 'mariadb::heartbeat':
        shard      => $shard,
        datacenter => $::site,
        enabled    => true,
    }

    class { 'mariadb::monitor_disk':
        is_critical   => $is_primary_master,
    }

    class { 'mariadb::monitor_process':
        is_critical   => $is_primary_master,
    }

    mariadb::monitor_eventscheduler { [ $shard ]:
        is_critical => false,
    }

    mariadb::monitor_readonly { [ $shard ]:
        read_only   => false,
        # XXX(kormat): Deliberately using $is_primary_master here rather than $is_master,
        # the inactive DC being read-only isn't a page-worthy event.
        is_critical => $is_primary_master,
    }

    if profile::mariadb::section_params::is_repl_client($shard, $mysql_role) {
        $source_dc = profile::mariadb::section_params::get_repl_src_dc($mysql_role)
        mariadb::monitor_replication { $shard:
            source_dc   => $source_dc,
        }
        # XXX(kormat): Disable this for now, it's incredibly spammy.
        # profile::mariadb::replication_lag { $shard: }
    }

    class { 'mariadb::monitor_memory': }
}