Make pxc-strict-mode configurable via charm

PXC5.7, which is default one on bionic, introduces the new config
option, pxc_stric_mode, which is set to 'enforcing' by default.

This, however, prevents installing older versions of Openstack
with PXC5.7 on bionic (use case is, of course, testing).

This change makes pxc-strict-mode configurable via the charm, and
it defaults it to 'enforcing', but user can change it at hers or
his desire.

This option is going to be ignored on PXC installed on series less
than bionic.

Change-Id: I7d82e8bea2e75da6159b5baf2e88f2bd44ce84b3
This commit is contained in:
Mario Splivalo 2018-04-30 18:57:53 +02:00 committed by Shane Peters
parent fce8db8756
commit 4ca460d56b
2 changed files with 11 additions and 1 deletions

View File

@ -227,6 +227,16 @@ options:
implication of this is one can set configuration values that could lead
to memory exhaustion during run time as memory is not allocated at
startup time.
pxc-strict-mode:
type: string
default: enforcing
description: |
Configures pxc_strict_mode (https://www.percona.com/doc/percona-xtradb-cluster/LATEST/features/pxc-strict-mode.html)
Valid values are 'disabled', 'permissive', 'enforcing' and 'master.'
Defaults to 'enforcing', as this is what PXC5.7 on bionic (and above)
does.
This option is ignored on PXC < 5.7 (xenial defaults to 5.6, trusty
defaults to 5.5)
tuning-level:
type: string
default: safest

View File

@ -216,7 +216,7 @@ def render_config(hosts=None):
context['default_storage_engine'] = 'InnoDB'
context['wsrep_log_conflicts'] = True
context['innodb_autoinc_lock_mode'] = '2'
context['pxc_strict_mode'] = 'ENFORCING'
context['pxc_strict_mode'] = config('pxc-strict-mode')
context.update(PerconaClusterHelper().parse_config())
render(os.path.basename(config_file), config_file, context, perms=0o444)