Merge lp:~mariosplivalo/charms/trusty/percona-cluster/lp1366997-workaround into lp:~openstack-charmers-archive/charms/trusty/percona-cluster/next

Proposed by Mario Splivalo
Status: Merged
Merged at revision: 46
Proposed branch: lp:~mariosplivalo/charms/trusty/percona-cluster/lp1366997-workaround
Merge into: lp:~openstack-charmers-archive/charms/trusty/percona-cluster/next
Diff against target: 87 lines (+27/-14)
3 files modified
config.yaml (+12/-8)
hooks/percona_hooks.py (+4/-1)
templates/my.cnf (+11/-5)
To merge this branch: bzr merge lp:~mariosplivalo/charms/trusty/percona-cluster/lp1366997-workaround
Reviewer Review Type Date Requested Status
Billy Olsen Approve
charmers Pending
Edward Hope-Morley Pending
Review via email: mp+249392@code.launchpad.net

This proposal supersedes a proposal from 2015-02-11.

Description of the change

This MP adds another percona-cluster charm config option, lp1366997-workaround, which adds a specific configuration to mysql so that primary key bug is avoided.

To post a comment you must log in.
Revision history for this message
Edward Hope-Morley (hopem) wrote : Posted in a previous version of this proposal

Mario gonna retarget to /next. Please backport to stable once merged.

Revision history for this message
Billy Olsen (billy-olsen) wrote : Posted in a previous version of this proposal

From my understanding this config flag option 'lp1366997-workaround' is a flag which will be short-lived and hopefully removed if the upstream fix gets backported. I think it'd be best if we can find a solution which avoids the need for future deprecation.

If we can, I think it my be a good idea to have a flexible option which allows other options to be defined in a configuration file in the conf.d directory. This allows us to address this use case and possible future use cases without having to do additional code change with the convenient side-effect of avoiding the option deprecation/removal.

At the very least I think the config option should be renamed to convey a better indicator of what is addressing (symptom even) rather than the lpbug-workaround.

One other possible option is to simply enable this workaround all the time within the template. I'm not entirely sure of what the side-effects are of enabling these options so that may be the least desirable due to inadvertent risk (which is why it is toggled in the first place).

review: Needs Fixing
Revision history for this message
Billy Olsen (billy-olsen) wrote :

After discussion, the config option name is acceptable although I'm still not a fan.

Otherwise, code looks fine. I'll approve and merge into the /next branches for now. You can work on a backport.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-02-06 09:48:02 +0000
3+++ config.yaml 2015-02-11 20:17:19 +0000
4@@ -61,11 +61,15 @@
5 disabled and a non-temporary address must be configured/available on
6 your network interface.
7 innodb-file-per-table:
8- type: boolean
9- default: True
10- description: |
11- Turns on innodb_file_per_table option, which will make MySQL put each
12- InnoDB table into separate .idb file. Existing InnoDB tables will remain
13- in ibdata1 file - full dump/import is needed to get rid of large
14- ibdata1 file
15-
16\ No newline at end of file
17+ type: boolean
18+ default: True
19+ description: |
20+ Turns on innodb_file_per_table option, which will make MySQL put each
21+ InnoDB table into separate .idb file. Existing InnoDB tables will remain
22+ in ibdata1 file - full dump/import is needed to get rid of large
23+ ibdata1 file
24+ lp1366997-workaround:
25+ type: boolean
26+ default: False
27+ description: Adds two config options (wsrep_drupal_282555_workaround and wsrep_retry_autocommit) as a workaround for Percona Primary Key bug (see lplp1366997).
28+
29
30=== modified file 'hooks/percona_hooks.py'
31--- hooks/percona_hooks.py 2015-02-10 11:27:46 +0000
32+++ hooks/percona_hooks.py 2015-02-11 20:17:19 +0000
33@@ -112,9 +112,12 @@
34 'cluster_hosts': ",".join(hosts),
35 'sst_method': 'xtrabackup',
36 'sst_password': mysql_password,
37- 'innodb_file_per_table': config('innodb-file-per-table')
38+ 'innodb_file_per_table': config('innodb-file-per-table'),
39+ 'lp1366997_workaround': config('lp1366997-workaround')
40 }
41
42+ print config
43+
44 if config('prefer-ipv6'):
45 # NOTE(hopem): this is a kludge to get percona working with ipv6.
46 # See lp 1380747 for more info. This is intended as a stop gap until
47
48=== modified file 'templates/my.cnf'
49--- templates/my.cnf 2015-02-06 09:48:02 +0000
50+++ templates/my.cnf 2015-02-11 20:17:19 +0000
51@@ -33,14 +33,13 @@
52 # This changes how InnoDB autoincrement locks are managed and is a requirement for Galera
53 innodb_autoinc_lock_mode=2
54
55+{% if innodb_file_per_table -%}
56 # This enables storing InnoDB tables in separate .ibd files. Note that, however
57-# existing InnoDB tables will remain in ibdata file(s) unles OPTIMIZE is run
58+# existing InnoDB tables will remain in ibdata file(s) unles OPTIMIZE is run
59 # on them. Still, the ibdata1 file will NOT shrink - a full dump/import of the
60 # data is needed in order to get rid of large ibdata file.
61-
62-{% if innodb_file_per_table %}
63 innodb_file_per_table = 1
64-{% else %}
65+{% else -%}
66 innodb_file_per_table = 0
67 {% endif %}
68
69@@ -69,10 +68,17 @@
70 # query cache is not supported with Active/Active configuration
71 innodb_buffer_pool_size = {{ dataset_bytes }}
72
73-{% if ipv6 %}
74+{% if ipv6 -%}
75 [sst]
76 sockopt=,pf=ip6
77 {% endif %}
78
79+{% if lp1366997_workaround -%}
80+# Adding workaround for bug:
81+# https://bugs.launchpad.net/charms/+source/percona-cluster/+bug/1366997
82+# Note that this should only be required for percona 5.5
83+wsrep_drupal_282555_workaround = ON
84+wsrep_retry_autocommit = 100
85+{% endif %}
86
87 !includedir /etc/mysql/conf.d/

Subscribers

People subscribed via source and target branches