Delete mysql error log file as root on restore
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack DBaaS (Trove) |
Fix Released
|
High
|
Petr Malik |
Bug Description
Delete mysql error log file as root on restore
The Problem:
The current code let's Python manage the MySQL error log file generated
during the root password reset on backup restore (see bug/1419995).
The problem is that the database service may assume ownership of that
file in the process. The 'restricted deletion' policy dictates that
only owners (and the directory owner) can delete temporary files.
If this happens the cleanup step fails halting the whole
restore process.
NOTE: Not all datastores neccessarilly exhibit this behavior
(i.e. taking ownership of the log file).
It has been confirmed on Percona 5.5 running under Ubuntu Linux.
The Reproduction (important):
This issue is masked in the default testing (redstack) environment.
Redstack (in 'scripts/
to the 'log_dir' value from 'etc/trove/
which happenns to be '/tmp/'.
Later in 'scripts/
of that directory: "chown GUEST_USERNAME:root GUEST_LOGDIR"
effectivelly hiding this issue.
The temporary directory would generally not be owned by the trove user
in a production environment.
In order to reproduce this issue in Redstack set 'GUEST_LOGDIR' to
some directory other than '/tmp', like '/var/log/trove/',
kick-start Percona 5.5 (remember to remove the cached
image if any) and run instance backup/restore or int-tests.
The Solution:
Do not let Trove do the cleanup on the error log file.
Force-delete the file as root, logging but not raising any exceptions.
Changed in trove: | |
assignee: | Petr Malik (pmalik) → Peter Stachowski (peterstac) |
Changed in trove: | |
assignee: | Peter Stachowski (peterstac) → nobody |
Changed in trove: | |
assignee: | nobody → Petr Malik (pmalik) |
Changed in trove: | |
milestone: | none → kilo-3 |
Changed in trove: | |
status: | Fix Committed → Fix Released |
Changed in trove: | |
milestone: | kilo-3 → 2015.1.0 |
Fix proposed to branch: master /review. openstack. org/157972
Review: https:/