diff --git a/lib/charms/mysql/v0/mysql.py b/lib/charms/mysql/v0/mysql.py index 418f540ce..2a4ae7b93 100644 --- a/lib/charms/mysql/v0/mysql.py +++ b/lib/charms/mysql/v0/mysql.py @@ -111,7 +111,7 @@ def wait_until_mysql_connection(self) -> None: # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 55 +LIBPATCH = 56 UNIT_TEARDOWN_LOCKNAME = "unit-teardown" UNIT_ADD_LOCKNAME = "unit-add" @@ -744,6 +744,8 @@ def render_mysqld_configuration( "general_log": "ON", "general_log_file": f"{snap_common}/var/log/mysql/general.log", "slow_query_log_file": f"{snap_common}/var/log/mysql/slowquery.log", + "innodb_flush_method": "O_DIRECT", + "innodb_use_fdatasync": "ON", } if innodb_buffer_pool_chunk_size: diff --git a/tests/unit/test_mysqlsh_helpers.py b/tests/unit/test_mysqlsh_helpers.py index bd19bd60d..38b45e1c0 100644 --- a/tests/unit/test_mysqlsh_helpers.py +++ b/tests/unit/test_mysqlsh_helpers.py @@ -272,6 +272,8 @@ def test_write_mysqld_config( "general_log = ON", "general_log_file = /var/snap/charmed-mysql/common/var/log/mysql/general.log", "slow_query_log_file = /var/snap/charmed-mysql/common/var/log/mysql/slowquery.log", + "innodb_flush_method = O_DIRECT", + "innodb_use_fdatasync = ON", "innodb_buffer_pool_chunk_size = 5678", "\n", ) @@ -312,6 +314,8 @@ def test_write_mysqld_config( "general_log = ON", "general_log_file = /var/snap/charmed-mysql/common/var/log/mysql/general.log", "slow_query_log_file = /var/snap/charmed-mysql/common/var/log/mysql/slowquery.log", + "innodb_flush_method = O_DIRECT", + "innodb_use_fdatasync = ON", "innodb_buffer_pool_chunk_size = 1048576", "performance-schema-instrument = 'memory/%=OFF'", "loose-group_replication_message_cache_size = 134217728",