[jjo, r=niedbalski] Fixes bug lp: #1386791.

- sync charmhelpers, then expose wait-timeout config
This commit is contained in:
Jorge Niedbalski 2015-03-04 14:42:16 -03:00
commit 99bb8eaabe
3 changed files with 12 additions and 2 deletions

View File

@ -11,6 +11,10 @@ options:
default: -1
type: int
description: Maximum connections to allow. -1 means use the server's compiled in default.
wait-timeout:
default: -1
type: int
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.
root-password:
type: string
default:

View File

@ -1,6 +1,5 @@
"""Helper for working with a MySQL database"""
import json
import socket
import re
import sys
import platform
@ -22,7 +21,6 @@ from charmhelpers.core.hookenv import (
log,
DEBUG,
INFO,
WARNING,
)
from charmhelpers.fetch import (
apt_install,
@ -359,6 +357,9 @@ class PerconaClusterHelper(object):
if 'max-connections' in config:
mysql_config['max_connections'] = config['max-connections']
if 'wait-timeout' in config:
mysql_config['wait_timeout'] = config['wait-timeout']
# Set a sane default key_buffer size
mysql_config['key_buffer'] = self.human_to_bytes('32M')
total_memory = self.human_to_bytes(self.get_mem_total())

View File

@ -59,6 +59,11 @@ wsrep_sst_auth="sstuser:{{ sst_password }}"
max_connections = {{ max_connections }}
{% endif %}
# Seconds before clearing idle connections
{% if wait_timeout != -1 %}
wait_timeout = {{ wait_timeout }}
{% endif %}
# Fine tuning
key_buffer_size = {{ key_buffer }}
table_open_cache = {{ table_open_cache }}