Mysqld_safe choose wrong MY_PWD

Bug #1721801 reported by Marco Tusa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
New
Undecided
EvgeniyPatlan

Bug Description

In upgrading from :
Percona-XtraDB-Cluster-5.7.14-rel8-26.17.1.Linux.x86_64.ssl101
to
Percona-XtraDB-Cluster-5.7.19-rel17-29.22.1.Linux.x86_64.ssl101

I had an issue and MySQL (PXC) did not start.
[mysql@galera1h1n5 galera1]$ 2017-10-06T14:11:17.687995Z mysqld_safe Logging to '/opt/mysql_instances/galera1/mysql-3306.err'.
2017-10-06T14:11:17.693932Z mysqld_safe Logging to '/opt/mysql_instances/galera1/mysql-3306.err'.
2017-10-06T14:11:17.704538Z mysqld_safe The file /mnt/workspace/percona-xtradb-cluster-5.7-binary-tarball/label_exp/centos6-64/Percona-XtraDB-Cluster-5.7.19-29.22/371/usr/local/Percona-XtraDB-Cluster-5.7.19-rel17-29.22.1.Linux.x86_64.ssl101/bin/mysqld
does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows:
./bin/mysqld_safe&
See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information

I am currently running PXC using TAR binaries and NON standard location.

Debugging a bit I found that mysqld_safe in the newest release is currently picking up the wrong path at line 579:
 case "$0" in
 580 /*)
 581 MY_PWD='/mnt/workspace/percona-xtradb-cluster-5.7-binary-tarball/label_exp/centos6-64/Percona-XtraDB-Cluster-5.7.19-29.22/371/usr/local/Percona-XtraDB -Cluster-5.7.19-rel17-29.22.1.Linux.x86_64.ssl101'
 582 ;;
 583 *)
 584 MY_PWD=`dirname $0`
 585 MY_PWD=`dirname $MY_PWD`
 586 ;;
 587 esac

While the OLD version at line 531:
 530
 531 MY_PWD=`pwd`
 532 # Check for the directories we would expect from a binary release install
 533 if test -n "$MY_BASEDIR_VERSION" -a -d "$MY_BASEDIR_VERSION"
 534 then

NEW execution (bash with -x)
Cluster-5.7.19-rel17-29.22.1.Linux.x86_64.ssl101,,' -e 's,^/,,' -e 's,^,./,'
+ relpkgdata=./share
+ case "$0" in
+ MY_PWD=/mnt/workspace/percona-xtradb-cluster-5.7-binary-tarball/label_exp/centos6-64/Percona-XtraDB-Cluster-5.7.19-29.22/371/usr/local/Percona-XtraDB-Clust
er-5.7.19-rel17-29.22.1.Linux.x86_64.ssl101
+ test -n '' -a -d ''

OLD execution (bash -x)
+ relpkgdata=./share
++ pwd
+ MY_PWD=/opt/mysql_templates/PXC-57
+ test -n '' -a -d ''

Commenting the new code and set the old assignment will make the mysqld_safe work correctly.
But I assume you were trying to do something with that change.

Revision history for this message
Marco Tusa (tusamarco) wrote :

forgot the paths are set like:
[mysql@galera1h1n5 galera1]$ cat start
#! /bin/bash --

MYSQL_CMD_DIR=/opt/mysql_templates/PXC-57
MYSQL_DIR=/opt/mysql_instances/galera1
MYSQL_UNIX_PORT=$MYSQL_DIR/mysql.sock
MYSQL_TCP_PORT=3306
export MYSQL_UNIX_PORT MYSQL_TCP_PORT MYSQL_DIR

cd $MYSQL_CMD_DIR
$MYSQL_CMD_DIR/bin/mysqld_safe --defaults-file=$MYSQL_DIR/my.cnf --basedir=/opt/mysql_templates/PXC-57 &

Changed in percona-xtradb-cluster:
assignee: nobody → EvgeniyPatlan (evgeniy-patlan)
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/PXC-2007

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.