From a8ca13e2bcd776a86938eded33e52c30217dab19 Mon Sep 17 00:00:00 2001 From: Gabriel PREDA Date: Mon, 24 Jan 2022 11:56:50 +0200 Subject: [PATCH 1/3] change expire_logs_days to binlog_expire_logs_seconds and remove innodb_file_format --- .gitignore | 1 + README.md | 2 +- defaults/main.yml | 3 +-- tasks/variables.yml | 5 +++++ templates/my.cnf.j2 | 3 +-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 554cc54a..6abc4132 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ */__pycache__ *.pyc .cache +.idea/ diff --git a/README.md b/README.md index 6a69c3b7..e62b9fab 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ The rest of the settings in `defaults/main.yml` control MySQL's memory usage and mysql_server_id: "1" mysql_max_binlog_size: "100M" mysql_binlog_format: "ROW" - mysql_expire_logs_days: "10" + mysql_binlog_expire_logs_seconds: "2592000" # default: 30 days mysql_replication_role: '' mysql_replication_master: '' mysql_replication_user: {} diff --git a/defaults/main.yml b/defaults/main.yml index 318b1694..f28d48e5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -90,7 +90,6 @@ mysql_innodb_lock_wait_timeout: "50" # These settings require MySQL > 5.5. mysql_innodb_large_prefix: "1" -mysql_innodb_file_format: "barracuda" # mysqldump settings. mysql_mysqldump_max_allowed_packet: "64M" @@ -123,7 +122,7 @@ mysql_users: [] mysql_server_id: "1" mysql_max_binlog_size: "100M" mysql_binlog_format: "ROW" -mysql_expire_logs_days: "10" +mysql_binlog_expire_logs_seconds: "2592000" mysql_replication_role: '' mysql_replication_master: '' # Same keys as `mysql_users` above. diff --git a/tasks/variables.yml b/tasks/variables.yml index 6e381067..8ed5bce0 100644 --- a/tasks/variables.yml +++ b/tasks/variables.yml @@ -57,3 +57,8 @@ set_fact: mysql_supports_innodb_large_prefix: "{{ __mysql_supports_innodb_large_prefix }}" when: mysql_supports_innodb_large_prefix is not defined + +- name: Compute mysql_binlog_expire_logs_seconds from mysql_expire_logs_days for backward compatibility + set_fact: + mysql_binlog_expire_logs_seconds: "{{ mysql_expire_logs_days * 24 * 3600 }}}" + when: mysql_expire_logs_days is defined and mysql_binlog_expire_logs_seconds != "2592000" diff --git a/templates/my.cnf.j2 b/templates/my.cnf.j2 index 78e4e912..0085485e 100644 --- a/templates/my.cnf.j2 +++ b/templates/my.cnf.j2 @@ -43,7 +43,7 @@ server-id = {{ mysql_server_id }} {% if mysql_replication_role == 'master' %} log_bin = mysql-bin log-bin-index = mysql-bin.index -expire_logs_days = {{ mysql_expire_logs_days }} +binlog_expire_logs_seconds = {{ mysql_binlog_expire_logs_seconds }} max_binlog_size = {{ mysql_max_binlog_size }} binlog_format = {{mysql_binlog_format}} @@ -100,7 +100,6 @@ event_scheduler = {{ mysql_event_scheduler_state }} # InnoDB settings. {% if mysql_supports_innodb_large_prefix and '8.0.' not in mysql_cli_version.stdout %} innodb_large_prefix = {{ mysql_innodb_large_prefix }} -innodb_file_format = {{ mysql_innodb_file_format }} {% endif %} innodb_file_per_table = {{ mysql_innodb_file_per_table }} innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }} From 0d66c272a9a6d9bb74b805a2e60d95b89bcc3680 Mon Sep 17 00:00:00 2001 From: Gabriel PREDA Date: Mon, 24 Jan 2022 11:58:57 +0200 Subject: [PATCH 2/3] remove innodb_large_prefix --- defaults/main.yml | 3 --- tasks/variables.yml | 5 ----- templates/my.cnf.j2 | 3 --- vars/Archlinux.yml | 1 - vars/Debian-10.yml | 1 - vars/Debian.yml | 1 - vars/RedHat-7.yml | 1 - vars/RedHat-8.yml | 3 --- 8 files changed, 18 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index f28d48e5..6614530f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -88,9 +88,6 @@ mysql_innodb_log_buffer_size: "8M" mysql_innodb_flush_log_at_trx_commit: "1" mysql_innodb_lock_wait_timeout: "50" -# These settings require MySQL > 5.5. -mysql_innodb_large_prefix: "1" - # mysqldump settings. mysql_mysqldump_max_allowed_packet: "64M" diff --git a/tasks/variables.yml b/tasks/variables.yml index 8ed5bce0..077d89e1 100644 --- a/tasks/variables.yml +++ b/tasks/variables.yml @@ -53,11 +53,6 @@ mysql_socket: "{{ __mysql_socket }}" when: mysql_socket is not defined -- name: Define mysql_supports_innodb_large_prefix. - set_fact: - mysql_supports_innodb_large_prefix: "{{ __mysql_supports_innodb_large_prefix }}" - when: mysql_supports_innodb_large_prefix is not defined - - name: Compute mysql_binlog_expire_logs_seconds from mysql_expire_logs_days for backward compatibility set_fact: mysql_binlog_expire_logs_seconds: "{{ mysql_expire_logs_days * 24 * 3600 }}}" diff --git a/templates/my.cnf.j2 b/templates/my.cnf.j2 index 0085485e..90c252c3 100644 --- a/templates/my.cnf.j2 +++ b/templates/my.cnf.j2 @@ -98,9 +98,6 @@ lower_case_table_names = {{ mysql_lower_case_table_names }} event_scheduler = {{ mysql_event_scheduler_state }} # InnoDB settings. -{% if mysql_supports_innodb_large_prefix and '8.0.' not in mysql_cli_version.stdout %} -innodb_large_prefix = {{ mysql_innodb_large_prefix }} -{% endif %} innodb_file_per_table = {{ mysql_innodb_file_per_table }} innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }} innodb_log_file_size = {{ mysql_innodb_log_file_size }} diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml index 2dd3c475..2c58b923 100644 --- a/vars/Archlinux.yml +++ b/vars/Archlinux.yml @@ -9,4 +9,3 @@ __mysql_pid_file: /run/mysqld/mysqld.pid __mysql_config_file: /etc/mysql/my.cnf __mysql_config_include_dir: /etc/mysql/conf.d __mysql_socket: /run/mysqld/mysqld.sock -__mysql_supports_innodb_large_prefix: true diff --git a/vars/Debian-10.yml b/vars/Debian-10.yml index cb4935ae..b54bb845 100644 --- a/vars/Debian-10.yml +++ b/vars/Debian-10.yml @@ -10,4 +10,3 @@ __mysql_pid_file: /run/mysqld/mysqld.pid __mysql_config_file: /etc/mysql/my.cnf __mysql_config_include_dir: /etc/mysql/conf.d __mysql_socket: /run/mysqld/mysqld.sock -__mysql_supports_innodb_large_prefix: true diff --git a/vars/Debian.yml b/vars/Debian.yml index a96a025c..8cbf579f 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -11,4 +11,3 @@ __mysql_pid_file: /var/run/mysqld/mysqld.pid __mysql_config_file: /etc/mysql/my.cnf __mysql_config_include_dir: /etc/mysql/conf.d __mysql_socket: /var/run/mysqld/mysqld.sock -__mysql_supports_innodb_large_prefix: true diff --git a/vars/RedHat-7.yml b/vars/RedHat-7.yml index 6f989b3a..db42ec39 100644 --- a/vars/RedHat-7.yml +++ b/vars/RedHat-7.yml @@ -13,4 +13,3 @@ __mysql_pid_file: /var/run/mariadb/mariadb.pid __mysql_config_file: /etc/my.cnf __mysql_config_include_dir: /etc/my.cnf.d __mysql_socket: /var/lib/mysql/mysql.sock -__mysql_supports_innodb_large_prefix: true diff --git a/vars/RedHat-8.yml b/vars/RedHat-8.yml index 12484af4..1901f110 100644 --- a/vars/RedHat-8.yml +++ b/vars/RedHat-8.yml @@ -13,6 +13,3 @@ __mysql_pid_file: /var/run/mariadb/mariadb.pid __mysql_config_file: /etc/my.cnf __mysql_config_include_dir: /etc/my.cnf.d __mysql_socket: /var/lib/mysql/mysql.sock -# The entries controlled by this value should not be used with MariaDB >= 10.2.2 -# See https://github.com/frappe/bench/issues/681#issuecomment-398984706 -__mysql_supports_innodb_large_prefix: false From dbf096d561939bc3f01d494fff398ea016ab4083 Mon Sep 17 00:00:00 2001 From: Gabriel PREDA Date: Mon, 24 Jan 2022 12:03:26 +0200 Subject: [PATCH 3/3] remove pdi-file --- templates/my.cnf.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/my.cnf.j2 b/templates/my.cnf.j2 index 90c252c3..0291d043 100644 --- a/templates/my.cnf.j2 +++ b/templates/my.cnf.j2 @@ -10,7 +10,6 @@ port = {{ mysql_port }} bind-address = {{ mysql_bind_address }} datadir = {{ mysql_datadir }} socket = {{ mysql_socket }} -pid-file = {{ mysql_pid_file }} {% if mysql_skip_name_resolve %} skip-name-resolve {% endif %} @@ -110,7 +109,6 @@ quick max_allowed_packet = {{ mysql_mysqldump_max_allowed_packet }} [mysqld_safe] -pid-file = {{ mysql_pid_file }} {% if mysql_config_include_files | length %} # * IMPORTANT: Additional settings that can override those from this file!