Debian series upgrade (e.g. 5.5->5.6) runs mysql_install_db

Bug #1631998 reported by Glenn Pratt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
New
Undecided
Unassigned

Bug Description

In #1507812, mysql_install_db was skipped on upgrade.

https://bugs.launchpad.net/percona-server/+bug/1507812

https://github.com/percona/percona-server/pull/366

However, it appears the postinst script is not aware that installing 5.6 over 5.5 is an upgrade and it still runs.

See this gist for full reproduction:

https://gist.github.com/glennpratt/319ca1440ae57d7f4060d8598b54997d

Here is a snip of the output with logging I added:

+ apt-get install -y --allow-unauthenticated percona-server-server-5.6=5.6.32-78.1-1.xenial~1
...
The following packages were automatically installed and are no longer required:
  libperconaserverclient18 percona-server-common-5.5
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libperconaserverclient18.1 percona-server-client-5.6
  percona-server-common-5.6
Suggested packages:
  tinyca
The following packages will be REMOVED:
  percona-server-client-5.5 percona-server-server-5.5
The following NEW packages will be installed:
  libperconaserverclient18.1 percona-server-client-5.6
  percona-server-common-5.6 percona-server-server-5.6
0 upgraded, 4 newly installed, 2 to remove and 4 not upgraded.
...
Setting up percona-server-server-5.6 (5.6.32-78.1-1.xenial~1) ...
Installing new version of config file /etc/init.d/mysql ...
<13>Oct 9 12:27:22 bug1507812: $0 == /var/lib/dpkg/info/percona-server-server-5.6.postinst
<13>Oct 9 12:27:22 bug1507812: $1 == configure
<13>Oct 9 12:27:22 bug1507812: $2 ==
<13>Oct 9 12:27:22 bug1507812: running mysql_install_db

Tags: pkg
Glenn Pratt (glennpratt)
description: updated
Revision history for this message
Tomislav Plavcic (tplavcic) wrote :

There's a simple explanation why this could happen, the logic checks if it's an package upgrade and then doesn't run the mysql_install_db. But Percona server packages are called differently and have a suffix (-5.5/5.6/5.7) by major version since we only have one repository and so we can't put the same package name in that repo for every major version. So the apt/dpkg doesn't realize that it's an upgrade (package name is different) and thinks we are just making a normal installation.
I didn't test this but from what I see it should be like that.

Also I think you made a mistake in the bug report title - most probably it shouldn't be "Minor version upgrades..." but instead "Major version upgrades..." - so if you agree feel free to fix it.
Not sure how it's going to be fixed but the logic in that "if" check will need to be changed.

tags: added: pkg
Revision history for this message
Glenn Pratt (glennpratt) wrote :

I agree that is the likely issue.

I might be confused, but 5.5 -> 5.6 is a minor version. (MAJOR.MINOR.PATCH)

I'm def. interested in how we detect this situation properly. Any direction there would be very helpful!

Revision history for this message
Tomislav Plavcic (tplavcic) wrote :

Sorry about the misunderstanding on versions, you are right about how we look at the full version number, but when upgrading from PS 5.5->5.6->5.7 due to the amount of changes we consider those to be major upgrades and upgrades from eg. 5.6.30->5.6.31 (smaller upgrades in the same series) only minor upgrades. I hope it makes sense.

Glenn Pratt (glennpratt)
summary: - Minor version upgrades run mysql_install_db
+ Debian series upgrade (e.g. 5.5->5.6) runs mysql_install_db
Revision history for this message
Glenn Pratt (glennpratt) wrote : Re: [Bug 1631998] Re: Minor version upgrades run mysql_install_db

Sorry, #4 was a mistake. Please ignore.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3576

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.