Merge lp:~jjo/charms/trusty/percona-cluster/add-wait-timeout into lp:~openstack-charmers-archive/charms/trusty/percona-cluster/next

Proposed by JuanJo Ciarlante
Status: Merged
Merged at revision: 52
Proposed branch: lp:~jjo/charms/trusty/percona-cluster/add-wait-timeout
Merge into: lp:~openstack-charmers-archive/charms/trusty/percona-cluster/next
Diff against target: 59 lines (+12/-2)
3 files modified
config.yaml (+4/-0)
hooks/charmhelpers/contrib/database/mysql.py (+3/-2)
templates/my.cnf (+5/-0)
To merge this branch: bzr merge lp:~jjo/charms/trusty/percona-cluster/add-wait-timeout
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+251760@code.launchpad.net
To post a comment you must log in.

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-16 14:12:42 +0000
3+++ config.yaml 2015-03-04 15:31:57 +0000
4@@ -11,6 +11,10 @@
5 default: -1
6 type: int
7 description: Maximum connections to allow. -1 means use the server's compiled in default.
8+ wait-timeout:
9+ default: -1
10+ type: int
11+ description: The number of seconds the server waits for activity on a noninteractive connection before closing it. -1 means use the server's compiled in default.
12 root-password:
13 type: string
14 default:
15
16=== modified file 'hooks/charmhelpers/contrib/database/mysql.py'
17--- hooks/charmhelpers/contrib/database/mysql.py 2015-02-27 10:17:54 +0000
18+++ hooks/charmhelpers/contrib/database/mysql.py 2015-03-04 15:31:57 +0000
19@@ -1,6 +1,5 @@
20 """Helper for working with a MySQL database"""
21 import json
22-import socket
23 import re
24 import sys
25 import platform
26@@ -22,7 +21,6 @@
27 log,
28 DEBUG,
29 INFO,
30- WARNING,
31 )
32 from charmhelpers.fetch import (
33 apt_install,
34@@ -359,6 +357,9 @@
35 if 'max-connections' in config:
36 mysql_config['max_connections'] = config['max-connections']
37
38+ if 'wait-timeout' in config:
39+ mysql_config['wait_timeout'] = config['wait-timeout']
40+
41 # Set a sane default key_buffer size
42 mysql_config['key_buffer'] = self.human_to_bytes('32M')
43 total_memory = self.human_to_bytes(self.get_mem_total())
44
45=== modified file 'templates/my.cnf'
46--- templates/my.cnf 2015-02-16 14:12:42 +0000
47+++ templates/my.cnf 2015-03-04 15:31:57 +0000
48@@ -59,6 +59,11 @@
49 max_connections = {{ max_connections }}
50 {% endif %}
51
52+# Seconds before clearing idle connections
53+{% if wait_timeout != -1 %}
54+wait_timeout = {{ wait_timeout }}
55+{% endif %}
56+
57 # Fine tuning
58 key_buffer_size = {{ key_buffer }}
59 table_open_cache = {{ table_open_cache }}

Subscribers

People subscribed via source and target branches