[MDEV-3624] LP:643463 - slow XtraDB shutdown due to 10 second sleep in purge thread Created: 2010-09-20 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Trivial |
| Reporter: | Kristian Nielsen | Assignee: | Kristian Nielsen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Shutting down XtraDB can take up to 10 seconds, even when there is no actual An easy way to see this is to run a quick innodb test in the mysql-test-run.pl ./mtr innodb-consistent This takes >10 seconds, even though the actual test runs instantaneous. The problem is this code in srv/srv0srv.c: srv_purge_thread(...) loop: os_thread_sleep( sleep_ms * 1000 ); So right after startup, the purge thread sleeps for 10 seconds, so server Of course, in a production server, the purge thread sleep could have adjusted But for development and testing, it is annoying to have to wait for 10 seconds Suggested fix: Change the os_thread_sleep() into a sleep that can be interrupted by |
| Comments |
| Comment by Kristian Nielsen [ 2010-09-20 ] |
|
Re: slow XtraDB shutdown due to 10 second sleep in purge thread |
| Comment by Kristian Nielsen [ 2010-09-30 ] |
|
Re: slow XtraDB shutdown due to 10 second sleep in purge thread (cd mysql-test && time ./mtr --mem --parallel=3 --force) (cd mysql-test && time ./mtr - So that's 38% faster ... so fixing this does seem rather worth-while. |
| Comment by Kristian Nielsen [ 2010-10-29 ] |
|
Re: slow XtraDB shutdown due to 10 second sleep in purge thread It greatly speeds up server shutdown for tests (though --innodb-fast-shutdown=2 is still a couple seconds faster). |
| Comment by Kristian Nielsen [ 2010-10-29 ] |
|
Here is a patch for this. It greatly speeds up server shutdown for tests (though --innodb-fast-shutdown=2 is still a couple seconds faster). |
| Comment by Kristian Nielsen [ 2010-11-03 ] |
|
Re: slow XtraDB shutdown due to 10 second sleep in purge thread |
| Comment by Kristian Nielsen [ 2010-11-03 ] |
|
I updated the patch, attached. I will push this patch into MariaDB, hopefully it can be included |
| Comment by Kristian Nielsen [ 2010-11-09 ] |
|
Re: slow XtraDB shutdown due to 10 second sleep in purge thread With this, server shutdown during mtr tests is very close to --innodb-fast-shutdown-2. |
| Comment by Kristian Nielsen [ 2010-11-09 ] |
|
I used PMP to find some more sleeps in the XtraDB shutdown code. This additional With this, server shutdown during mtr tests is very close to --innodb-fast-shutdown-2. |
| Comment by Kristian Nielsen [ 2010-11-16 ] |
|
Re: slow XtraDB shutdown due to 10 second sleep in purge thread |
| Comment by Kristian Nielsen [ 2010-11-16 ] |
|
Attaching BSD copyright license for the patches submitted to this bug report. |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 643463 |