[MDEV-11226] MariaDB hang at MDL_context::acquire_lock , and thread pool was blocked, could not create additional thread to handle queries Created: 2016-11-03 Updated: 2017-02-21 Resolved: 2017-02-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.0.19 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | catofpei | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
suse 11 SP1 x86_64 |
||
| Description |
|
|
| Comments |
| Comment by Vladislav Vaintroub [ 2016-11-03 ] | ||||||||||||||||||||||||||||
|
do you have the output of gdb thread apply all bt ? Also error log, and my.cnf would be helpful too. what were the threadpool related parameters? | ||||||||||||||||||||||||||||
| Comment by catofpei [ 2016-11-03 ] | ||||||||||||||||||||||||||||
|
Here is the my.cnf parameters about threadpool:
////////////////////////////////////////////////////////////////////////
And MariaDB Connector/C client hang at:
even a simple SQL like "select 1 from dual" was hanged. ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// very confused.. | ||||||||||||||||||||||||||||
| Comment by Vladislav Vaintroub [ 2016-11-03 ] | ||||||||||||||||||||||||||||
|
I hoped the message in error log was helpful. thread_pool_max_threads is the hard limit of number of threads in the threadpool. It might be 500 or so as default. If this is less than max_connections, it can deadlock on a global lock. It won't ever deadlock if you size it as max_connections + thread_pool_size. Also, the message about extra_port is accurate. If you had enabled it, you could connect as superuser and resolve the deadlock by setting thread_pool_max_threads higher. That client hangs is because the server does not answer. The server does not answer because it is stalled, because the thread_pool_max_threads had reached. So I suggest to set thread_pool_max_threads=60000 or something big enough for you to never see this message again. | ||||||||||||||||||||||||||||
| Comment by catofpei [ 2016-11-03 ] | ||||||||||||||||||||||||||||
|
which global lock ? And I'm confused why threads were blocked at open tables procedure ? .. | ||||||||||||||||||||||||||||
| Comment by Vladislav Vaintroub [ 2016-11-03 ] | ||||||||||||||||||||||||||||
|
It does not matter which lock, for the purpose of explaining threadpool. In this case it is MDL lock. It is possible to google to find out what an MDL lock does. It can theoretically be a table lock, user lock, "flush table with read lock" lock. It can also be a row lock in Innodb as well, if everyone is waiting for a specific row. | ||||||||||||||||||||||||||||
| Comment by Vladislav Vaintroub [ 2016-11-04 ] | ||||||||||||||||||||||||||||
|
catofpei IS there anything else needing clarification? mdl lock is probably a result of LOCK TABLES or FLUSH TABLES WITH READ LOCK. you can know it better than we. | ||||||||||||||||||||||||||||
| Comment by catofpei [ 2016-11-12 ] | ||||||||||||||||||||||||||||
|
Very sorry for my delayed reply. I tried to increase the threadpool_max_threads value as you advised. And the test result was OK! In our test code, there were scenarios in which some threads tried to update the same row , But we have no operations like "FLUSH TABLES" 、"LOCK TABLES" 、 DDL operations. Maybe as you wrote, "it can also be a row lock in Innodb" .. |