[MDEV-17003] service_manager_extend_timeout() being called too often Created: 2018-08-16 Updated: 2018-12-07 Resolved: 2018-08-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.1.33, 10.2.15, 10.3.6 |
| Fix Version/s: | 10.1.36, 10.2.18, 10.3.10 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | performance, regression, systemd | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
The function srv_do_purge() is invoking service_manager_extend_timeout() without any rate limit, wasting CPU in both the MariaDB server and systemd. The call would only make sense during a slow shutdown SET GLOBAL innodb_fast_shutdown=0. Even then, it would make sense to rate-limit the output, and write an accumulated count only every N seconds. The purpose of the call is to prevent systemd from killing the server due to seeming hang, and to inform the user about the progress. It would be even more useful if there was an indication of work that remains to be done. Also other calls to service_manager_extend_timeout() should be appropriately rate-limited and possibly disabled outside startup or shutdown. danblack, as the contributor of |
| Comments |
| Comment by Daniel Black [ 2018-08-16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Default time out is https://www.freedesktop.org/software/systemd/man/systemd.service.html#TimeoutStopSec= which falls back to https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html#DefaultTimeoutStartSec= (90s). | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-08-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I checked all the InnoDB calls to service_manager_extend_timeout(), and in addition to the one in srv_purge_should_exit(), which actually looks like it should be executed on a slow shutdown only, there are calls in buf_dump() and log_write_up_to() that could be less frequent:
Next, I am trying to test if srv_purge_should_exit() could emit the output outside a slow shutdown SET GLOBAL innodb_fast_shutdown=0. I am also trying to see how that output could be rate-limited. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-08-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It turns out that in 10.3.6, as part of this merge the call to service_manager_extend_timeout() was moved to srv_do_purge(), and it is being executed also outside a slow shutdown (innodb_fast_shutdown=0). |