Merge lp:~niedbalski/charms/trusty/percona-cluster/fix-lp1461669 into lp:~openstack-charmers-archive/charms/trusty/percona-cluster/next

Proposed by Jorge Niedbalski
Status: Merged
Approved by: Billy Olsen
Approved revision: 64
Merged at revision: 63
Proposed branch: lp:~niedbalski/charms/trusty/percona-cluster/fix-lp1461669
Merge into: lp:~openstack-charmers-archive/charms/trusty/percona-cluster/next
Diff against target: 79 lines (+22/-12)
3 files modified
config.yaml (+10/-2)
hooks/charmhelpers/contrib/database/mysql.py (+11/-9)
templates/my.cnf (+1/-1)
To merge this branch: bzr merge lp:~niedbalski/charms/trusty/percona-cluster/fix-lp1461669
Reviewer Review Type Date Requested Status
Billy Olsen Approve
Felipe Reyes Approve
Review via email: mp+261092@code.launchpad.net

Description of the change

Fixes LP bug: #1461669

To post a comment you must log in.
Revision history for this message
Felipe Reyes (freyes) wrote :

Hi Jorge, just a minor comment, the rest LGTM.

review: Needs Fixing
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #4736 percona-cluster-next for niedbalski mp261092
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/4736/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #5057 percona-cluster-next for niedbalski mp261092
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/5057/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #4464 percona-cluster-next for niedbalski mp261092
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/11567355/
Build: http://10.245.162.77:8080/job/charm_amulet_test/4464/

64. By Jorge Niedbalski

Addressed @freyes comment

Revision history for this message
Felipe Reyes (freyes) wrote :

Thanks Jorge, LGTM

review: Approve
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #4737 percona-cluster-next for niedbalski mp261092
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/4737/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #5058 percona-cluster-next for niedbalski mp261092
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/5058/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #4465 percona-cluster-next for niedbalski mp261092
    AMULET FAIL: amulet-test missing

AMULET Results (max last 2 lines):
INFO:root:Search string not found in makefile target commands.
ERROR:root:No make target was executed.

Full amulet test output: http://paste.ubuntu.com/11567908/
Build: http://10.245.162.77:8080/job/charm_amulet_test/4465/

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

LGTM Approved. Thanks for the submission Jorge!

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-04-21 09:29:08 +0000
3+++ config.yaml 2015-06-04 15:11:49 +0000
4@@ -10,9 +10,9 @@
5 Key ID to import to the apt keyring to support use with arbitary source
6 configuration from outside of Launchpad archives or PPA's.
7 dataset-size:
8- default: '80%'
9+ default:
10 type: string
11- description: How much data do you want to keep in memory in the DB. This will be used to tune settings in the database server appropriately. Suffix this value with 'K','M','G', or 'T' to get the relevant kilo/mega/etc. bytes. If suffixed with %, one will get that percentage of RAM devoted to dataset.
12+ description: (deprecated) How much data do you want to keep in memory in the DB. This will be used to tune settings in the database server appropriately. Suffix this value with 'K','M','G', or 'T' to get the relevant kilo/mega/etc. bytes. If suffixed with %, one will get that percentage of RAM devoted to dataset.
13 max-connections:
14 default: -1
15 type: int
16@@ -103,3 +103,11 @@
17 description: |
18 A comma-separated list of nagios servicegroups.
19 If left empty, the nagios_context will be used as the servicegroup
20+ innodb-buffer-pool-size:
21+ default:
22+ type: string
23+ description: |
24+ By default this value will be set according to the 50% of system total memory
25+ but also can be set to any specific value for the system.
26+ Suffix this value with 'K','M','G', or 'T' to get the relevant kilo/mega/etc. bytes.
27+ If suffixed with %, one will get that percentage of system total memory devoted.
28
29=== modified file 'hooks/charmhelpers/contrib/database/mysql.py'
30--- hooks/charmhelpers/contrib/database/mysql.py 2015-05-13 10:21:30 +0000
31+++ hooks/charmhelpers/contrib/database/mysql.py 2015-06-04 15:11:49 +0000
32@@ -385,23 +385,25 @@
33 mysql_config['key_buffer'] = self.human_to_bytes('32M')
34 total_memory = self.human_to_bytes(self.get_mem_total())
35
36- log("Option 'dataset-size' has been deprecated, instead by default %d%% of system \
37- available RAM will be used for innodb_buffer_pool_size allocation" %
38- (self.DEFAULT_INNODB_BUFFER_FACTOR * 100), level="WARN")
39-
40+ dataset_bytes = config.get('dataset-size', None)
41 innodb_buffer_pool_size = config.get('innodb-buffer-pool-size', None)
42
43 if innodb_buffer_pool_size:
44 innodb_buffer_pool_size = self.human_to_bytes(
45 innodb_buffer_pool_size)
46-
47- if innodb_buffer_pool_size > total_memory:
48- log("innodb_buffer_pool_size; {} is greater than system available memory:{}".format(
49- innodb_buffer_pool_size,
50- total_memory), level='WARN')
51+ elif dataset_bytes:
52+ log("Option 'dataset-size' has been deprecated, please use"
53+ "innodb_buffer_pool_size option instead", level="WARN")
54+ innodb_buffer_pool_size = self.human_to_bytes(
55+ dataset_bytes)
56 else:
57 innodb_buffer_pool_size = int(
58 total_memory * self.DEFAULT_INNODB_BUFFER_FACTOR)
59
60+ if innodb_buffer_pool_size > total_memory:
61+ log("innodb_buffer_pool_size; {} is greater than system available memory:{}".format(
62+ innodb_buffer_pool_size,
63+ total_memory), level='WARN')
64+
65 mysql_config['innodb_buffer_pool_size'] = innodb_buffer_pool_size
66 return mysql_config
67
68=== modified file 'templates/my.cnf'
69--- templates/my.cnf 2015-04-20 10:53:43 +0000
70+++ templates/my.cnf 2015-06-04 15:11:49 +0000
71@@ -72,7 +72,7 @@
72
73 # InnoDB buffer should consume 100% of the bytes of the dataset size
74 # query cache is not supported with Active/Active configuration
75-innodb_buffer_pool_size = {{ dataset_bytes }}
76+innodb_buffer_pool_size = {{ innodb_buffer_pool_size }}
77
78 {% if ipv6 -%}
79 [sst]

Subscribers

People subscribed via source and target branches