[MDEV-15609] engines/funcs.crash_manytables_number crashes with error 24 (too many open files) Created: 2018-03-20  Updated: 2018-03-26  Resolved: 2018-03-26

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.2
Fix Version/s: 10.1.32

Type: Bug Priority: Major
Reporter: Michael Widenius Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-10286 Adjustment of table_open_cache accord... Closed

 Description   

mtr engines/funcs.crash_manytables_number

engines/funcs.crash_manytables_number 'innodb' [ pass ]  46262
engines/funcs.crash_manytables_number 'myisam' [ fail ]
CURRENT_TEST: engines/funcs.crash_manytables_number
mysqltest: At line 966: query 'CREATE TABLE t482 (c1 INTEGER) ' failed: 1005: Can't create table `test`.`t482` (errno: 24 "Too many open files")

This happens because we don't adjust the size of open table cache based on the number of files we can open.

The current code adjust tc_size only if the following is true:

  (!open_files_limit || IS_SYSVAR_AUTOSIZE(&open_files_limit))

The code should be adjusted so that we always adjust tc_size if it's bigger than

(files - 10 - max_connections) / 2

(I think that 10 is probably too low, we may need more file descriptors for temporary files etc).

Currently the tc_size has a lower value of TABLE_OPEN_CACHE_MIN, which is 400.
I think this should be made lower to at least 200 as it's more important that we get correct operations than run faster to a problem.

Suggested fix:

  • Move code for adjusting tc_size out of current block and to be always
    tested. Write a warning if warning_level > 1 if it's adjusted
  • Change TABLE_OPEN_CACHE_MIN to 200
  • Change '10' to '30', to get a margin
  • Ensure that mtr engines/funcs.crash_manytables_number works, even when
    running it in a loop for a few times

When mysqld is started with systemd, the number of files that can be
opened is 64K and all of the above changes will have no affect. In
other words, this change mostly affect development and test systems
and when running mysql-test-run. It should not affect production systems.



 Comments   
Comment by Michael Widenius [ 2018-03-26 ]

Fixed by adjusting tc_size downwards if there is not enough file descriptors to use.

Generated at Thu Feb 08 08:22:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.