Percona Server 5.7 can't be restarted after TokuDB has been installed with ps_tokudb_admin

Bug #1527535 reported by Hrvoje Matijakovic
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.6
Invalid
Undecided
Unassigned
5.7
Fix Released
Medium
Tomislav Plavcic

Bug Description

After Tokudb get installed with ps_tokudb_admin in Percona Server 5.7 server can't be restarted due to error:

mysqld_safe mysqld_safe must be run as root for setting transparent huge pages!

Commenting out :
thp-setting=never

in my.cnf resolves this issue, but then THP could be re-enabled after server restart causing issues for TokuDB.

Tags: pkg tokudb
tags: added: pkg tokudb
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :
Download full text (5.1 KiB)

This is because of when you are going to install percona-server-server-5.7 it will remove percona-server-tokudb-5.6 but not install new percona-server-tokudb-5.7 package :

root@percona-XPS-15:~# sudo apt-get install percona-server-server-5.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  percona-server-client-5.7 percona-server-common-5.7
The following packages will be REMOVED:
  percona-server-client-5.6 percona-server-server-5.6
  percona-server-tokudb-5.6
The following NEW packages will be installed:
  percona-server-client-5.7 percona-server-common-5.7
  percona-server-server-5.7

Process Will end up:

No directory, logging in with HOME=/
.151228 10:46:59 mysqld_safe mysqld_safe must be run as root for setting transparent huge pages!
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Killing the process:
............../var/lib/dpkg/info/percona-server-server-5.7.postinst: line 87: 5963 Killed invoke-rc.d mysql start
dpkg: error processing package percona-server-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 137
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 percona-server-server-5.7

If you remove thp-setting=never from my.cnf still will not be able to start PS with TokuDB:

2015-12-28T06:57:08.671881Z 0 [ERROR] Can't open shared library '/usr/lib/mysql/plugin/tokudb_backup.so' (errno: 0 /usr/lib/mysql/plugin/tokudb_backup.so: cannot open shared ob
ject file: No such file or directory)
2015-12-28T06:57:08.671887Z 0 [Warning] Couldn't load plugin named 'tokudb_backup' with soname 'tokudb_backup.so'.
2015-12-28T06:57:08.671901Z 0 [ERROR] Can't open shared library '/usr/lib/mysql/plugin/ha_tokudb.so' (errno: 0 /usr/lib/mysql/plugin/ha_tokudb.so: cannot open shared object fil
e: No such file or directory)
2015-12-28T06:57:08.671905Z 0 [Warning] Couldn't load plugin named 'TokuDB' with soname 'ha_tokudb.so'.
2015-12-28T06:57:08.671914Z 0 [ERROR] Can't open shared library '/usr/lib/mysql/plugin/ha_tokudb.so' (errno: 0 /usr/lib/mysql/plugin/ha_tokudb.so: cannot open shared object fil
e: No such file or directory)
2015-12-28T06:57:08.671917Z 0 [Warning] Couldn't load plugin named 'TokuDB_file_map' with soname 'ha_tokudb.so'.
2015-12-28T06:57:08.671926Z 0 [ERROR] Can't open shared library '/usr/lib/mysql/plugin/ha_tokudb.so' (errno: 0 /usr/lib/mysql/plugin/ha_tokudb.so: cannot open shared object fil
e: No such file or directory)
2015-12-28T06:57:08.671929Z 0 [Warning] Couldn't load plugin named 'TokuDB_fractal_tree_info' with soname 'ha_tokudb.so'.
2015-12-28T06:57:08.671938Z 0 [ERROR] Can't open shared library '/usr/lib/mysql/p...

Read more...

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

This issue is happening because in 5.6 the mysqld_safe was run as root user. In 5.7 upstream runs it as mysql user.
Now since we need to run it as root user because of some tokudb pre-requisites I will change it so that it runs as root. If there will be complaints we will see how to proceed.

@rzayev-sehriyar
The thing here is that percona-server-server package doesn't depend on tokudb package. TokuDB package depends on the server package.
So if you did run "apt-get upgrade" or "apt-get dist-upgrade" or specifying "apt-get install percona-server-server-5.7 percona-server-tokudb-5.7" it would work.
I think it works the same between different 5.6 versions so not sure currently what can be done with that.

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

Reverted the previous fix as it wasn't complete and it wasn't a good idea.
The new fix was done here: https://github.com/percona/percona-server/pull/342

Basically mysqld_safe is run as mysql user but we have added a check into init scripts which run with root permissions before mysqld_safe to check for THP setting and set it if needed.
This is much cleaner solution.

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-3346

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.