LP #1441087: enforce_storage_engine and debian-start, mysql_upgrade
Description
Environment
Smart Checklist
Activity

lpjirasync January 22, 2018 at 11:41 AM
**Comment from Launchpad by: Tomislav Plavcic on: 28-04-2016 08:13:49
5.7 unaffected as it doesn't run mysql_upgrade automatically.

lpjirasync January 22, 2018 at 11:41 AM
**Comment from Launchpad by: Nilnandan Joshi on: 26-05-2015 09:36:51
https://bugs.launchpad.net/percona-server/+bug/1236938 has been merged in newer versions.
So as per last comment in this bug, https://bugs.launchpad.net/percona-server/+bug/1218664
If using enforce-storage-engine, we must either disable it before doing mysql_upgrade or perform mysql_upgrade with server started with --skip-grants-tables. This changes is not done in debian-start yet.
nilnandan@desktop:~$ cat /etc/mysql/debian-start
#!/bin/bash
#
This script is executed by "/etc/init.d/mysql" on every (re)start.
Changes to this file will be preserved when updating the Debian package.
#
PERCONA_PREFIX=/usr
source "${PERCONA_PREFIX}"/share/mysql/debian-start.inc.sh
MYSQL="${PERCONA_PREFIX}/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
MYADMIN="${PERCONA_PREFIX}/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
MYUPGRADE="${PERCONA_PREFIX}/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
MYCHECK="${PERCONA_PREFIX}/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
MYCHECK_PARAMS="--all-databases --fast --silent"
MYCHECK_RCPT="root"
The following commands should be run when the server is up but in background
where they do not block the server start and in one shell instance so that
they run sequentially. They are supposed not to echo anything to stdout.
If you want to disable the check for crashed tables comment
"check_for_crashed_tables" out.
(There may be no output to stdout inside the background process!)
echo "Checking for corrupt, not cleanly closed and upgrade needing tables."
(
upgrade_system_tables_if_necessary;
check_root_accounts;
check_for_crashed_tables;
) >&2 &
exit 0
nilnandan@desktop:~
Details
Assignee
UnassignedUnassignedReporter
lpjirasynclpjirasync(Deactivated)Labels
Components
Priority
High
Details
Details
Assignee
Reporter

Labels
Components
Priority
Smart Checklist
Open Smart Checklist
Smart Checklist
Open Smart Checklist
Smart Checklist

**Reported in Launchpad by Raghavendra D Prabhu last update 28-04-2016 08:13:49
debian-start is invoked automatically on PS.
However, due to https://bugs.launchpad.net/percona-server/+bug/1218664 this can corrupt mysql/PFS database tables (one reported quite recently), something that mysql_upgrade doesn't fix either (requires load from a mysqldump).
So, either
> Change debian-start to invoke with --skip-grant-tables for mysql_upgrade by default.
> Disable invocation of mysql_upgrade from debian-start
> Fix the issue in 1218664 (will file a separate issue, found something based on my investigation).