On upgrade from dev-db/mysql-5.1.56 to dev-db/mysql-5.1.61 /var/lib/mysql is gone from the filesystem. This machine is part of a failover cluster so /var/lib/mysql is mounted and populated only during a failover (i.e during upgrade /var/lib/mysql was empty). With no /var/lib/mysql after upgrade, failover will fail as it won't be able to find the mount point. Quick look suggests that mysql.eclass seems to keepdir the DATADIR whereas mysql-v2.eclass does not. Please consider restoring the keepdir behaviour for DATADIR in mysql-v2.eclass. Reproducible: Always
The logic is exactly the same, it's just not in mysql-v2.eclass. old logic: if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then dodir "${MY_DATADIR#${EPREFIX}}" keepdir "${MY_DATADIR#${EPREFIX}}" chown -R mysql:mysql "${D}/${MY_DATADIR}" fi new logic (mysql-cmake.eclass / mysql-autotools.eclass): if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then dodir "${MY_DATADIR#${EPREFIX}}" keepdir "${MY_DATADIR#${EPREFIX}}" chown -R mysql:mysql "${D}/${MY_DATADIR}" fi I don't know why it cares about PREVIOUS_DATADIR however, I think it should always be doing keepdir. Does the old mysql.eclass based ebuilds also not keepdir?
Hem, at the time of writing that check I've simply put all together, the idea is that if the datadir was present it's totally user responsibility. The logic can be wrong, what happen if: a) portage 1st install mysql b) portage update mysql b1) mysql is built but datadir is already present b2) portage merge the file in the filesystem w/o the keepdir b3) portage remove superfluous files, included keepdir so yes, the keepdir should always be done, or at least check that the previous datadir is != /var/lib/mysql
Created attachment 301379 [details, diff] mysql-autotools.patch Just confirming that moving keepdir out of the if...then preserves the datadir directory on upgrade. Ditto for mysql-cmake.eclass probably.
(In reply to comment #1) > The logic is exactly the same, it's just not in mysql-v2.eclass. > > old logic: > if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then > dodir "${MY_DATADIR#${EPREFIX}}" > keepdir "${MY_DATADIR#${EPREFIX}}" > chown -R mysql:mysql "${D}/${MY_DATADIR}" > fi > > new logic (mysql-cmake.eclass / mysql-autotools.eclass): > if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then > dodir "${MY_DATADIR#${EPREFIX}}" > keepdir "${MY_DATADIR#${EPREFIX}}" > chown -R mysql:mysql "${D}/${MY_DATADIR}" > fi > > > I don't know why it cares about PREVIOUS_DATADIR however, I think it should > always be doing keepdir. > > Does the old mysql.eclass based ebuilds also not keepdir? Robin, I can't check the eclasses now, but I suspect it might be tied to the PREFIX support added to the eclasses.
InCVS