From e75da71ca9a0880676ce506fe0a1804296103ca6 Mon Sep 17 00:00:00 2001 From: Bitnami Bot Date: Thu, 7 Apr 2022 17:04:08 +0000 Subject: [PATCH] 10.5.15-debian-10-r51 release --- .../debian-10/rootfs/opt/bitnami/scripts/libmariadb.sh | 5 +++++ .../rootfs/opt/bitnami/scripts/mariadb-env.sh | 10 ++++++++++ .../rootfs/opt/bitnami/scripts/mariadb/postunpack.sh | 2 +- bitnami/mariadb/README.md | 9 ++++++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/libmariadb.sh b/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/libmariadb.sh index ad6ca69bc80a..acb4a8f1aa50 100644 --- a/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/libmariadb.sh +++ b/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/libmariadb.sh @@ -154,6 +154,9 @@ pid_file=${DB_PID_FILE} max_allowed_packet=16M bind_address=${DB_DEFAULT_BIND_ADDRESS} log_error=${DB_LOGS_DIR}/mysqld.log +slow_query_log=${DB_ENABLE_SLOW_QUERY} +slow_query_log_file=${DB_LOGS_DIR}/mysqld.log +long_query_time=${DB_LONG_QUERY_TIME} character_set_server=${DB_DEFAULT_CHARACTER_SET} collation_server=${DB_DEFAULT_COLLATE} plugin_dir=${DB_BASE_DIR}/lib/plugin @@ -1249,6 +1252,8 @@ mysql_update_custom_config() { ! is_empty_value "$DB_BIND_ADDRESS" && mysql_conf_set "bind_address" "$DB_BIND_ADDRESS" ! is_empty_value "$DB_AUTHENTICATION_PLUGIN" && mysql_conf_set "default_authentication_plugin" "$DB_AUTHENTICATION_PLUGIN" ! is_empty_value "$DB_SQL_MODE" && mysql_conf_set "sql_mode" "$DB_SQL_MODE" + ! is_empty_value "$DB_ENABLE_SLOW_QUERY" && mysql_conf_set "slow_query_log" "$DB_ENABLE_SLOW_QUERY" + ! is_empty_value "$DB_LONG_QUERY_TIME" && mysql_conf_set "long_query_time" "$DB_LONG_QUERY_TIME" # Avoid exit code of previous commands to affect the result of this function true diff --git a/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/mariadb-env.sh b/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/mariadb-env.sh index 5590c11c17d9..42c40d468c4d 100644 --- a/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/mariadb-env.sh +++ b/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/mariadb-env.sh @@ -51,6 +51,10 @@ mariadb_env_vars=( MARIADB_CLIENT_EXTRA_FLAGS MARIADB_STARTUP_WAIT_RETRIES MARIADB_STARTUP_WAIT_SLEEP_TIME + MARIADB_ENABLE_SLOW_QUERY + MARIADB_LONG_QUERY_TIME + DB_ENABLE_SLOW_QUERY + DB_LONG_QUERY_TIME ) for env_var in "${mariadb_env_vars[@]}"; do file_env_var="${env_var}_FILE" @@ -156,5 +160,11 @@ export MARIADB_STARTUP_WAIT_RETRIES="${MARIADB_STARTUP_WAIT_RETRIES:-300}" export DB_STARTUP_WAIT_RETRIES="$MARIADB_STARTUP_WAIT_RETRIES" export MARIADB_STARTUP_WAIT_SLEEP_TIME="${MARIADB_STARTUP_WAIT_SLEEP_TIME:-2}" export DB_STARTUP_WAIT_SLEEP_TIME="$MARIADB_STARTUP_WAIT_SLEEP_TIME" +MARIADB_ENABLE_SLOW_QUERY="${MARIADB_ENABLE_SLOW_QUERY:-"${DB_ENABLE_SLOW_QUERY:-}"}" +export MARIADB_ENABLE_SLOW_QUERY="${MARIADB_ENABLE_SLOW_QUERY:-0}" +export DB_ENABLE_SLOW_QUERY="$MARIADB_ENABLE_SLOW_QUERY" +MARIADB_LONG_QUERY_TIME="${MARIADB_LONG_QUERY_TIME:-"${DB_LONG_QUERY_TIME:-}"}" +export MARIADB_LONG_QUERY_TIME="${MARIADB_LONG_QUERY_TIME:-10.0}" +export DB_LONG_QUERY_TIME="$MARIADB_LONG_QUERY_TIME" # Custom environment variables may be defined below diff --git a/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/mariadb/postunpack.sh b/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/mariadb/postunpack.sh index 992e242d4ff2..cb03885dd20a 100755 --- a/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/mariadb/postunpack.sh +++ b/bitnami/mariadb/10.5/debian-10/rootfs/opt/bitnami/scripts/mariadb/postunpack.sh @@ -28,4 +28,4 @@ done ln -sf "$DB_BASE_DIR/plugin" "$DB_BASE_DIR/lib/plugin" # Redirect all logging to stdout -ln -sf /dev/stdout "$DB_LOGS_DIR/mysqld.log" +ln -sf "/proc/1/fd/1" "$DB_LOGS_DIR/mysqld.log" diff --git a/bitnami/mariadb/README.md b/bitnami/mariadb/README.md index c7f44b54afb1..19c8c1c0057e 100644 --- a/bitnami/mariadb/README.md +++ b/bitnami/mariadb/README.md @@ -52,7 +52,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t * [`10.7`, `10.7-debian-10`, `10.7.3`, `10.7.3-debian-10-r19`, `latest` (10.7/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mariadb/blob/10.7.3-debian-10-r19/10.7/debian-10/Dockerfile) * [`10.6`, `10.6-debian-10`, `10.6.7`, `10.6.7-debian-10-r49` (10.6/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mariadb/blob/10.6.7-debian-10-r49/10.6/debian-10/Dockerfile) -* [`10.5`, `10.5-debian-10`, `10.5.15`, `10.5.15-debian-10-r50` (10.5/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mariadb/blob/10.5.15-debian-10-r50/10.5/debian-10/Dockerfile) +* [`10.5`, `10.5-debian-10`, `10.5.15`, `10.5.15-debian-10-r51` (10.5/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mariadb/blob/10.5.15-debian-10-r51/10.5/debian-10/Dockerfile) * [`10.4`, `10.4-debian-10`, `10.4.24`, `10.4.24-debian-10-r50` (10.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mariadb/blob/10.4.24-debian-10-r50/10.4/debian-10/Dockerfile) * [`10.3`, `10.3-debian-10`, `10.3.34`, `10.3.34-debian-10-r52` (10.3/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mariadb/blob/10.3.34-debian-10-r52/10.3/debian-10/Dockerfile) * [`10.2`, `10.2-debian-10`, `10.2.43`, `10.2.43-debian-10-r49` (10.2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mariadb/blob/10.2.43-debian-10-r49/10.2/debian-10/Dockerfile) @@ -346,6 +346,13 @@ services: ... ``` +### Slow query logs + +By default MariaDB doesn't enable [slow query log](https://mariadb.com/kb/en/slow-query-log-overview/) to record the SQL queries that take a long time to perform. You can modify these settings using the following environment variables: + +- `MARIADB_ENABLE_SLOW_QUERY`: Whether to enable slow query logs. Default: `0` +- `MARIADB_LONG_QUERY_TIME`: How much time, in seconds, defines a slow query. Default: `10.0` + ### Slow filesystems In some platforms, the filesystem used for persistence could be slow. That could cause the database to take extra time to be ready. If that's the case, you can configure the `MARIADB_INIT_SLEEP_TIME` environment variable to make the initialization script to wait extra time (in seconds) before proceeding with the configuration operations.