In-Place upgrade from 5.6 to 5.7 using Standalone Packages fails

Bug #1687276 reported by Miguel Angel Nieto on 2017-04-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to
Status tracked in 5.7
Fix Released

Bug Description

If you follow the steps in the documentation, the installation of 5.7 server package will fail.

2017-04-30T09:58:53.300380Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2017-04-30T09:58:53.300458Z 0 [ERROR] Aborting

If this is an upgrade from 5.6 to 5.7 it is supposed that the datadir has data inside. But if it is not empty, the package installation will fail. The workaround is:

1- mv the content of the datadir somewhere else
2- finish the package installation.
3- stop mysql
4- remove the content of the datadir and get the copy from step 1 back.

There is no mention in the guide about the problems with datadir or how to really handle the upgrade when there is already data there.

tags: added: i184693
tags: added: doc pkg

An update about the bug after some more tests:

- The postinst script assumes the datadir is /var/lib/mysql and doesn't actually check the conf. If there is no such directory, it also assumes a new installation and then it fails because it tries to initialize the real datadir specified in the conf. Something that cannot be done because there is data there.

- Creating a dummy file in /var/lib/mysql works as workaround, because it then assumes there is already data, therefore it is an upgrade and the process proceeds without problem.

A "proof of concept" patch for the postinst script. Similar changes would be needed in the config, postrm and preinst scripts.

Changed in percona-server:
status: New → Confirmed

Tested in:

5.7_5.7.17-13 - Ubuntu 14.04.5

Changed in percona-server:
assignee: nobody → EvgeniyPatlan (evgeniy-patlan)
EvgeniyPatlan (evgeniy-patlan) wrote :
Changed in percona-server:
status: Confirmed → Fix Committed
Changed in percona-server:
milestone: none → 5.7.18-14
status: Fix Committed → Fix Released

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers