From 4ca460d56b025b541ad6ee41baf10852ed48aed0 Mon Sep 17 00:00:00 2001 From: Mario Splivalo Date: Mon, 30 Apr 2018 18:57:53 +0200 Subject: [PATCH] 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 --- config.yaml | 10 ++++++++++ hooks/percona_hooks.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config.yaml b/config.yaml index 8a5c8e0..17b996d 100644 --- a/config.yaml +++ b/config.yaml @@ -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 diff --git a/hooks/percona_hooks.py b/hooks/percona_hooks.py index 25e9de5..9b0788e 100755 --- a/hooks/percona_hooks.py +++ b/hooks/percona_hooks.py @@ -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)