aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ansible/group_vars/all/mariadb.yml6
-rw-r--r--ansible/roles/mariadb/templates/galera.cnf.j22
-rw-r--r--releasenotes/notes/bugfix-bump-mariadb-innodb-log-file-size-6d280b738baa3897.yaml23
3 files changed, 31 insertions, 0 deletions
diff --git a/ansible/group_vars/all/mariadb.yml b/ansible/group_vars/all/mariadb.yml
index 289fde77e..d7f0f8a51 100644
--- a/ansible/group_vars/all/mariadb.yml
+++ b/ansible/group_vars/all/mariadb.yml
@@ -43,3 +43,9 @@ mariadb_backup_target: replica
mariadb_shard_root_user_prefix: "root_shard_"
mariadb_shard_backup_user_prefix: "backup_shard_"
mariadb_shards_info: "{{ groups['mariadb'] | database_shards_info() }}"
+
+# Size in mega-bytes of each InnoDB redo log file in the log group.
+# Allowed minimum is 4MB and maximum is 524288MB (512GB).
+# Larger values mean less disk I/O due to less flushing checkpoint activity,
+# but also slower recovery from a crash.
+mariadb_innodb_log_file_size_mb: 2048
diff --git a/ansible/roles/mariadb/templates/galera.cnf.j2 b/ansible/roles/mariadb/templates/galera.cnf.j2
index dcb84fcdf..90ad20522 100644
--- a/ansible/roles/mariadb/templates/galera.cnf.j2
+++ b/ansible/roles/mariadb/templates/galera.cnf.j2
@@ -61,6 +61,8 @@ innodb_buffer_pool_size = '8192M'
innodb_flush_log_at_trx_commit = 0
innodb_autoinc_lock_mode = 2
+innodb_log_file_size = '{{ mariadb_innodb_log_file_size_mb }}M'
+
[server]
pid-file=/var/lib/mysql/mariadb.pid
diff --git a/releasenotes/notes/bugfix-bump-mariadb-innodb-log-file-size-6d280b738baa3897.yaml b/releasenotes/notes/bugfix-bump-mariadb-innodb-log-file-size-6d280b738baa3897.yaml
new file mode 100644
index 000000000..3dafce0c8
--- /dev/null
+++ b/releasenotes/notes/bugfix-bump-mariadb-innodb-log-file-size-6d280b738baa3897.yaml
@@ -0,0 +1,23 @@
+---
+features:
+ - |
+ Increased the default value of ``innodb_log_file_size`` from 96MB to 2GB.
+ This change improves overall performance of MariaDB.
+ However, the recovery of MariaDB may take longer time as a tradeoff.
+ Users can adjust the value by overriding K-A variable
+ ``mariadb_innodb_log_file_size_mb``.
+ The allowed minimum is 4MB and maximum is 524288MB (512GB)
+upgrade:
+ - |
+ The default value of ``innodb_log_file_size`` has increased from 96MB to
+ 2GB.
+ This improves MariaDB performance but recovery time from crash may take
+ longer time as a tradeoff.
+ Users are recommended to consider the recovery time with new default
+ before upgrade.
+ Users are recommended to check if disk space is enough with larger InnoDB
+ log file.
+fixes:
+ - |
+ Fixes bug `LP#2129930 <https://bugs.launchpad.net/kolla-ansible/+bug/2129930>`__
+ which made Zuul CI to fail MariaDB backup test sometimes.