From bb702c2e4c24632678b548ee1515c6a5b8173808 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 26 Jun 2019 19:47:56 +0300 Subject: [PATCH] Limit minium aria_block_size to 4096 MDEV-19585 Assertion with S3 table and flush_tables The limit has to be increased so that MariaDB can create system tables. It should not have any notable impact on performance. There should not be any notable performance differences between 1K and 4K, especially for temporary tables. In most cases using bigger blocks is also faster (with the possible exception of doing key reads of not fixed length keys). --- mysql-test/suite/sys_vars/r/sysvars_aria.result | 2 +- storage/maria/ha_maria.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria.result b/mysql-test/suite/sys_vars/r/sysvars_aria.result index 6516260a05d..4fdb82f8510 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_aria.result +++ b/mysql-test/suite/sys_vars/r/sysvars_aria.result @@ -9,7 +9,7 @@ DEFAULT_VALUE 8192 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Block size to be used for Aria index pages. -NUMERIC_MIN_VALUE 1024 +NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 32768 NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 76991621def..43eb7ff7dde 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -152,10 +152,11 @@ static void update_log_file_size(MYSQL_THD thd, struct st_mysql_sys_var *var, void *var_ptr, const void *save); +/* The 4096 is there because of MariaDB privilege tables */ static MYSQL_SYSVAR_ULONG(block_size, maria_block_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Block size to be used for Aria index pages.", 0, 0, - MARIA_KEY_BLOCK_LENGTH, MARIA_MIN_KEY_BLOCK_LENGTH, + MARIA_KEY_BLOCK_LENGTH, 4096, MARIA_MAX_KEY_BLOCK_LENGTH, MARIA_MIN_KEY_BLOCK_LENGTH); static MYSQL_SYSVAR_ULONG(checkpoint_interval, checkpoint_interval,