Commit d0df63cf by Julien Muchembled

NEO: only load MariaDB plugin for chosen engine

For the test suite, all plugins are still loaded if no engine is specified.

Loading TokuDB whereas RocksDB is used is quite annoying because:
- TokuDB creates many threads
- RocksDB opens many files
We had systems where lsof takes a few minutes to output 10 million lines.

This will also make the datadir a bit cleaner.
1 parent b71ce50e
......@@ -25,6 +25,7 @@ error-log = ${directory:log}/mariadb_error.log
slow-query-log = ${directory:log}/mariadb_slowquery.log
extra-dict = {{ dumps(slapparameter_dict.get('mysql', {})) }}
init-file = ${init-script:rendered}
engine = {{ slapparameter_dict.get('engine', '') }}
[my-cnf]
recipe = slapos.recipe.template:jinja2
......@@ -104,7 +105,7 @@ cluster = {{ dumps(slapparameter_dict['cluster']) }}
masters = ${publish:masters}
database-adapter = {{ storage_type }}
wait-database = -1
engine = {{ slapparameter_dict.get('engine', '') }}
engine = ${my-cnf-parameters:engine}
dedup = {{ dumps(bool(slapparameter_dict.get('data-deduplication'))) }}
disable-drop-partitions = {{ dumps(bool(slapparameter_dict.get('disable-drop-partitions'))) }}
......
{% macro assert(x) %}{{ ("",)[not x] }}{% endmacro -%}
{% set socket = parameter_dict['socket'] -%}
{% set extra_dict = parameter_dict['extra-dict'] -%}
{% set engine = parameter_dict['engine'] -%}
{% set plugins = [] -%}
{% if not engine or engine == 'InnoDB' -%}
{% do extra_dict.setdefault('innodb_file_per_table', '1') -%}
{% endif -%}
{% if not engine or engine == 'RocksDB' -%}
{% do plugins.append('ha_rocksdb') -%}
{% endif -%}
{% if not engine or engine == 'TokuDB' -%}
{% do plugins.append('ha_tokudb') -%}
{% endif -%}
[mysqld]
skip_networking
socket = {{ socket }}
......@@ -14,8 +28,9 @@ slow_query_log_file = {{ parameter_dict['slow-query-log'] }}
init_file = {{ parameter_dict['init-file'] }}
log_warnings = 1
disable-log-bin
plugin-load = ha_tokudb;ha_rocksdb
{%- if plugins %}
plugin-load = {{ ';'.join(plugins) }}
{%- endif %}
## The following settings come from ERP5 configuration.
......@@ -32,7 +47,6 @@ innodb_locks_unsafe_for_binlog = 1
{{x}}sync_frm = 0
# Extra parameters.
{%- do extra_dict.setdefault('innodb_file_per_table', '1') %}
{%- for k, v in extra_dict.iteritems() %}
{%- do assert('-' not in k) %}
{{ k }} = {{ v }}
......
......@@ -110,12 +110,12 @@ md5sum = 1fee10f02c2fa2a581e21878ca0fd704
[instance-neo]
<= download-base-neo
md5sum = a9e5cad9cdb5fd3f1ae7b1d534f967ae
md5sum = d4e30d74316e6931da4a1e305f9bbc68
[template-neo-my-cnf]
<= download-base-neo
url = ${:_profile_base_location_}/my.cnf.in
md5sum = 87d18c7021e4d43756813a83c9da5e97
md5sum = 9f6f8f2b5f4cb0d97d50ffc1d3837e2f
[versions]
BTrees = 4.4.1
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!