Increase maximum shell command timeout to 2h
[armband.git] / patches / fuel-library / 0013-Allow-configuring-MySQL-WSREP-SST-provider.patch
1 From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
2 Date: Wed, 20 Apr 2016 14:54:42 -0700
3 Subject: [PATCH] Allow configuring MySQL WSREP SST provider
4
5 On some arm64 platforms xtrabackup is broken due to an outdated
6 MySQL/InnoDB code that it uses which is missing. To work around that
7 this patch allows choosing which WSREP SST provider to use. Aside of
8 already supported `xtrabackup-v2` and `mysqldump`, the `rsync` method
9 has been added as it is comparable to xtrabackup in terms of speed (or
10 is faster), has been validated to work on arm64 platforms where
11 xtrabackup is broken and it doesn't rely on db mechanisms to perform the
12 state transfer.
13
14 This patch is tied to a patch in fuel-web that introduces configuration
15 options for WSREP SST provider and in case nothing is specified, it
16 will choose `xtrabackup-v2`.
17
18 Signed-off-by: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
19 ---
20  deployment/puppet/galera/manifests/init.pp                | 15 ++++++++++++++-
21  deployment/puppet/mysql/manifests/server.pp               |  4 ++++
22  .../puppet/osnailyfacter/modular/database/database.pp     |  7 +++++++
23  3 files changed, 25 insertions(+), 1 deletion(-)
24
25 diff --git a/deployment/puppet/galera/manifests/init.pp b/deployment/puppet/galera/manifests/init.pp
26 index 7f25ab3..12ad387 100644
27 --- a/deployment/puppet/galera/manifests/init.pp
28 +++ b/deployment/puppet/galera/manifests/init.pp
29 @@ -51,7 +51,7 @@
30  # [*wsrep_sst_method*]
31  #  (optional) The method for state snapshot transfer between nodes
32  #  Defaults to xtrabackup-v2
33 -#  xtrabackup, xtrabackup-v2, mysqldump are supported
34 +#  xtrabackup, xtrabackup-v2, mysqldump and rsync are supported
35  #
36  # [*use_percona*]
37  #  Boolean. Set this value to true if you want to use percona instead of
38 @@ -199,6 +199,19 @@ class galera (
39    elsif $wsrep_sst_method == 'mysqldump' {
40      $wsrep_sst_auth = true
41    }
42 +  elsif $wsrep_sst_method == 'rsync' {
43 +    firewall {'101 mysql-rsync':
44 +      port   => 4444,
45 +      proto  => 'tcp',
46 +      action => 'accept',
47 +      before => Package['MySQL-server'],
48 +    }
49 +    package { 'rsync':
50 +      ensure => present,
51 +      before => Package['MySQL-server'],
52 +    }
53 +    $wsrep_sst_auth = undef
54 +  }
55    else {
56      $wsrep_sst_auth = undef
57      warning("Unrecognized wsrep_sst method: ${wsrep_sst_auth}")
58 diff --git a/deployment/puppet/mysql/manifests/server.pp b/deployment/puppet/mysql/manifests/server.pp
59 index 4cce092..631ed69 100644
60 --- a/deployment/puppet/mysql/manifests/server.pp
61 +++ b/deployment/puppet/mysql/manifests/server.pp
62 @@ -42,6 +42,7 @@ class mysql::server (
63    $use_syslog              = true,
64    $wait_timeout            = $mysql::params::wait_timeout,
65    $ignore_db_dirs          = $mysql::params::ignore_db_dirs,
66 +  $wsrep_sst_method        = 'xtrabackup-v2',
67  ) inherits mysql::params {
68  
69    if ($config_hash['config_file']) {
70 @@ -226,6 +227,7 @@ class mysql::server (
71        gcache_factor      => $galera_gcache_factor,
72        skip_name_resolve  => $mysql_skip_name_resolve,
73        use_syslog         => $use_syslog,
74 +      wsrep_sst_method   => $wsrep_sst_method,
75        wsrep_sst_password => $root_password,
76      }
77  
78 @@ -240,6 +242,7 @@ class mysql::server (
79        gcache_factor      => $galera_gcache_factor,
80        skip_name_resolve  => $mysql_skip_name_resolve,
81        use_syslog         => $use_syslog,
82 +      wsrep_sst_method   => $wsrep_sst_method,
83        wsrep_sst_password => $root_password,
84        use_percona        => true,
85      }
86 @@ -253,6 +256,7 @@ class mysql::server (
87        gcache_factor        => $galera_gcache_factor,
88        skip_name_resolve    => $mysql_skip_name_resolve,
89        use_syslog           => $use_syslog,
90 +      wsrep_sst_method     => $wsrep_sst_method,
91        wsrep_sst_password   => $root_password,
92        use_percona          => true,
93        use_percona_packages => true
94 diff --git a/deployment/puppet/osnailyfacter/modular/database/database.pp b/deployment/puppet/osnailyfacter/modular/database/database.pp
95 index d3fb736..d7ca319 100644
96 --- a/deployment/puppet/osnailyfacter/modular/database/database.pp
97 +++ b/deployment/puppet/osnailyfacter/modular/database/database.pp
98 @@ -1,10 +1,15 @@
99  notice('MODULAR: database.pp')
100  
101 +$default_wsrep_hash = {
102 +  'wsrep_method' => 'xtrabackup-x2',
103 +}
104 +
105  $network_scheme = hiera_hash('network_scheme', {})
106  prepare_network_config($network_scheme)
107  $use_syslog               = hiera('use_syslog', true)
108  $primary_controller       = hiera('primary_controller')
109  $mysql_hash               = hiera_hash('mysql', {})
110 +$wsrep_hash               = hiera_hash('mysql_wsrep', $default_wsrep_hash)
111  $management_vip           = hiera('management_vip')
112  $database_vip             = hiera('database_vip', $management_vip)
113  
114 @@ -17,6 +22,7 @@ $haproxy_stats_url    = "http://${database_vip}:${haproxy_stats_port}/;csv"
115  
116  $mysql_database_password   = $mysql_hash['root_password']
117  $enabled                   = pick($mysql_hash['enabled'], true)
118 +$wsrep_sst_method          = $wsrep_hash['wsrep_method']
119  
120  $galera_node_address       = get_network_role_property('mgmt/database', 'ipaddr')
121  $galera_nodes              = values(get_node_to_ipaddr_map_by_network_role(hiera_hash('database_nodes'), 'mgmt/database'))
122 @@ -78,6 +84,7 @@ if $enabled {
123      use_syslog              => $use_syslog,
124      config_hash             => $config_hash_real,
125      ignore_db_dirs          => $ignore_db_dirs,
126 +    wsrep_sst_method        => $wsrep_sst_method,
127    }
128  
129    class { 'osnailyfacter::mysql_user':