mysql ocf script broken in 1:1.0.3-2ubuntu1 (lucid)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cluster-agents (Ubuntu) |
Fix Released
|
Medium
|
Adam Gandelman | ||
Hardy |
Invalid
|
Undecided
|
Unassigned | ||
Lucid |
Fix Released
|
Medium
|
Unassigned | ||
Natty |
Fix Released
|
Undecided
|
Unassigned | ||
Precise |
Fix Released
|
Medium
|
Adam Gandelman |
Bug Description
Due to ubuntu putting /var/run on a tempory fs the /var/run/mysqld directory is removed upon a reboot. Mysql will fail to start via the crm after next boot as it cannot access or find the the needed /var/run/mysqld directory.
This directory is created in the OCF script in the mysql_start() function , but for some reason not until after the script checks for the directory and write permissions, logs an error, and exits. (Line 345)
I have fixed it by merely moving the if statement which test -w the pid_dir to after the if statements which create the pid_dir (line 350)
SRU Justification:
[Impact]
/var/run/mysqld directory is typically created by pre-start in the mysql upstart job prior to starting the service every boot, as /var/run is tempfs and its contents ephemeral. Users of the Linux HA stack typically hand over control of specific services to the cluster managed by OCF scripts. The OCF script to manage mysql should take the same steps the required directories are present. A bug exists in the version of the mysql OCF script shipped in 1:1.0.3-2ubuntu1 which prevents the required directories from being created if they do not exist. If the clustered service is configured to use /var/run/mysqld (the ubuntu default for certain files), the cluster will fail to start mysql after a reboot. As most users of the cluster agent anticipate a *highly* available service, graceful system reboots should not result in an unavailable service.
[Development Fix]
As Florian Hass pointed out, this has been fixed upstream over a year ago and is not present in the current development release (precise, package renamed resource agents 1:3.9.2-5ubuntu1)
[Stable Fix]
A trivial fix at https:/
[Test Case]
See http://
[Regression Potential]
Minimal chance of regression. Change simply ensures mysql directories exist before they are checked for write permissions. The change only affects the mysql OCF agent, all others are untouched.
Related branches
- James Page: Pending requested
-
Diff: 111 lines (+65/-4)5 files modified.pc/applied-patches (+1/-0)
debian/changelog (+8/-0)
debian/patches/mysql_move_writable_test.patch (+45/-0)
debian/patches/series (+1/-0)
heartbeat/mysql (+10/-4)
Changed in cluster-agents (Ubuntu): | |
assignee: | nobody → Adam Gandelman (gandelman-a) |
status: | Fix Committed → Confirmed |
status: | Confirmed → In Progress |
Changed in cluster-agents (Ubuntu Hardy): | |
status: | New → Incomplete |
status: | Incomplete → Invalid |
Changed in cluster-agents (Ubuntu Lucid): | |
assignee: | nobody → Adam Gandelman (gandelman-a) |
status: | New → In Progress |
description: | updated |
Changed in cluster-agents (Ubuntu Lucid): | |
assignee: | Adam Gandelman (gandelman-a) → nobody |
tags: |
added: verification-done removed: verification-needed |
I fixed this upstream more than a year ago:
https:/ /github. com/ClusterLabs /resource- agents/ commit/ a1801207e0602d9 b975f336569b562 c195a6eb8a
Ubuntu maintainers are welcome to apply the patch and reroll the package.