Hi, Oleksandr! Ok to push. Just one comment, see below: On Jan 19, Oleksandr Byelkin wrote:
revision-id: edc9059c31b (mariadb-10.2.28-3-gedc9059c31b) parent(s): 0b1bc4bf76f author: Oleksandr Byelkin <sanja@mariadb.com> committer: Oleksandr Byelkin <sanja@mariadb.com> timestamp: 2019-11-05 16:24:26 +0100 message:
MDEV-18027: Running out of file descriptors and eventual crash
For automatic number of opened files limit take into account number of table instances for table cache
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 34e5704bcfe..9907c17ee07 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4461,6 +4461,17 @@ static int init_common_variables() if (files < wanted_files && global_system_variables.log_warnings) sql_print_warning("Could not increase number of max_open_files to more than %u (request: %u)", files, wanted_files);
+ /* + If we required too much tc_instances than we reduce it but not more + then in half
The comment is wrong, you don't do "not more than in half", you can reduce it all the way to 1. Which, I think, it correct. So the code is ok, but the comment is misleading, please remove the "but not more than in half" part.
+ */ + SYSVAR_AUTOSIZE_IF_CHANGED(tc_instances, + (uint32) MY_MIN(MY_MAX((files - extra_files - + max_connections)/ + 2/tc_size, + 1), + tc_instances), + uint32); /* If we have requested too much file handles than we bring max_connections in supported bounds. Still leave at least
Regards, Sergei VP of MariaDB Server Engineering and security@mariadb.org