[MDEV-6669] Restarting mariadb-server 10 service on ubuntu 14.04 fails Created: 2014-08-30 Updated: 2014-10-09 Due: 2014-10-16 Resolved: 2014-10-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.0.13-galera |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Bruce Kirkpatrick | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
ubuntu 14.04 |
||
| Attachments: |
|
| Description |
|
I installed mariadb via the ubuntu 14.04 repo and documentation provided on mariadb.org. I found the /etc/init.d/mysql script wasn't waiting for mysqld to fully shutdown after running mysqladmin shutdown in the init script. There is logic that looks for an error condition and then runs a sequence to verify it has finished shutting down. For some reason, it is not able to return an error condition for mysqladmin shutdown on this platform, so the stop() function completes too early and then start() fails and this leaves the mysql process not running. If you run service mysql restart again, it works, because enough time has passed for mysqladmin shutdown to complete. I found I could fix this by forcing the following shell script code to run immediately after this line:
but before this line:
new code:
Please verify/fix for the benefit of others. I'm also using the innodb pool dump feature, which makes it take longer to shutdown possibly. |
| Comments |
| Comment by Sergei Golubchik [ 2014-09-04 ] |
|
Unfortunately, I was not able to repeat this issue. Nor can I see (by looking at the source code) how could mysqladmin possibly return wrong error code. Even with long shutdown times mysqladmin will wait. |
| Comment by Sergei Golubchik [ 2014-09-04 ] |
|
Could you provide some additional information that would help me to repeat this issue? |
| Comment by Bruce Kirkpatrick [ 2014-09-04 ] |
|
I attached the my.cnf options I'm using. If this doesn't reproduce the service mysql restart fail problem, let me know. I had this happen on 3 different installs of ubuntu 14/mysql using the same steps - i changed the system in several ways, so it could be something else. I do have my complete installation steps for setting up ubuntu published online, but that would be too much work to ask you to go through. |
| Comment by Elena Stepanova [ 2014-10-04 ] |
|
Hi Bruce, Are you actually using 10.0.13-galera, as the "Affected Version/s" field says? |
| Comment by Bruce Kirkpatrick [ 2014-10-04 ] |
|
I use the default /etc/mysql/my.cnf and also include this file in conf.d directory. It seems I already included the configuration file in original post... |
| Comment by Bruce Kirkpatrick [ 2014-10-04 ] |
|
Hi Elena, mysqladmin shutdown has no output, because it does complete successfully. The problem with "service mysql restart" is that it doesn't wait long enough for that shutdown to complete, so then it can't start the server again. It is like mysqladmin shutdown is an asynchronous command, but the init script assumes it is synchronous. When I set the /etc/init.d/mysql back to how it was, this issue is still able to be reproduced. I attached my mysql configuration settings. Version output below: root@jetendo:~# dpkg -l | grep -iE 'mysql|maria' |
| Comment by Elena Stepanova [ 2014-10-08 ] |
|
Hi Bruce, Thanks for the data.
When you run it manually, you can run it with --verbose option ( mysqadmin --defaults-file=/etc/mysql/debian.cnf --verbose shutdown ) |
| Comment by Bruce Kirkpatrick [ 2014-10-08 ] |
|
I intentionally changed debian.cnf to use TCP because it wasn't working right with the default socket method at some point. It appears you've isolated the problem. I could stop using TCP or continue to use the workaround I came up with. |
| Comment by Elena Stepanova [ 2014-10-09 ] |
|
The difference between socket (local) connections and TCP connections in mysqladmin is intentional – obviously, it only makes sense to wait on the pid file if the connection is definitely local. I suppose hypothetically it could be made to distinguish between local TCP connections and remote TCP connections, but I'm not sure it's worth the trouble. So, for now I'm closing the issue as 'Not a bug'. Please comment to re-open if you disagree. |