Merge "CentOS 8: Upgrade mariadb to version 10.3.17" into f/centos8
This commit is contained in:
commit
018a0afba7
@ -10,7 +10,6 @@ initscripts-10.00.1-1.el8_0.1.src.rpm
|
||||
# libevent-2.0.21-4.el7.src.rpm
|
||||
lighttpd-1.4.55-1.el8.src.rpm
|
||||
# logrotate-3.8.6-17.el7.src.rpm
|
||||
mariadb-10.3.17-1.module_el8.1.0+257+48736ea6.src.rpm
|
||||
net-snmp-5.8-7.el8_0.2.src.rpm
|
||||
net-tools-2.0-0.51.20160912git.el8.src.rpm
|
||||
openldap-2.4.46-11.el8_1.src.rpm
|
||||
|
@ -34,7 +34,7 @@ ldapscripts-2.0.8.tgz#ldapscripts-2.0.8#https://sourceforge.net/projects/ldapscr
|
||||
libtpms-0.6.0-4f0d59d.tar.gz#libtpms-0.6.0#https://github.com/stefanberger/libtpms/tarball/c421ca0f4d00c0caceeda8d62c1efb2b7e47db04#http##
|
||||
lldpd-0.9.0.tar.gz#lldpd-0.9.0#https://media.luffy.cx/files/lldpd/lldpd-0.9.0.tar.gz#http##
|
||||
lua-1fce39c6397056db645718b8f5821571d97869a4.tar.gz#lua#https://api.github.com/repos/ceph/lua/tarball/1fce39c6397056db645718b8f5821571d97869a4#https##
|
||||
!mariadb-10.1.28.tar.gz#mariadb-10.1.28#https://github.com/MariaDB/server/archive/mariadb-10.1.28.tar.gz#http_script##post-dl-script/mariadb.sh
|
||||
!mariadb-10.3.17.tar.gz#mariadb-10.3.17#https://github.com/MariaDB/server/archive/mariadb-10.3.17.tar.gz#http_script##post-dl-script/mariadb.sh
|
||||
!MLNX_OFED_SRC-4.7-3.2.9.0.tgz#MLNX_OFED_SRC-4.7-3.2.9.0#http://content.mellanox.com/ofed/MLNX_OFED-4.7-3.2.9.0/MLNX_OFED_SRC-4.7-3.2.9.0.tgz#http_script##post-dl-script/MLNX_OFED.sh
|
||||
openvswitch-2.11.0.tar.gz#openvswitch-2.11.0#https://github.com/openvswitch/ovs/archive/v2.11.0.tar.gz#http##
|
||||
puppet-boolean-22b726dd78b0a60a224cc7054aebbf28e9306f62.tar.gz#puppet-boolean#https://github.com/voxpupuli/puppet-boolean/tarball/22b726dd78b0a60a224cc7054aebbf28e9306f62#http##
|
||||
|
@ -1,4 +1,4 @@
|
||||
COPY_LIST="$CGCS_BASE/downloads/mariadb-10.1.28.tar.gz $PKG_BASE/centos/files/*"
|
||||
COPY_LIST="$CGCS_BASE/downloads/mariadb-10.3.17.tar.gz $PKG_BASE/centos/files/*"
|
||||
TIS_PATCH_VER=15
|
||||
BUILD_IS_BIG=7
|
||||
BUILD_IS_SLOW=19
|
||||
|
@ -1,13 +0,0 @@
|
||||
This directory contains prepared configuration files with .cnf extension,
|
||||
which provide a configuration for some common MariaDB deployment scenarios.
|
||||
These configuration files do not include the default configuration of datadir,
|
||||
log-file and pid-file locations, as specified in the default my.cnf file,
|
||||
provided in this distribution.
|
||||
|
||||
Thus, it is recommended to use these configuration files as an addition to the
|
||||
default my.cnf configuration file.
|
||||
|
||||
Since default my.cnf contains `!includedir @INSTALL_SYSCONF2DIR@` directive, it is
|
||||
recommended to copy required configuration under @INSTALL_SYSCONF2DIR@ directory,
|
||||
so the default my.cnf specifications will be extended.
|
||||
|
132
database/mariadb/centos/files/README.wsrep_sst_rsync_tunnel
Normal file
132
database/mariadb/centos/files/README.wsrep_sst_rsync_tunnel
Normal file
@ -0,0 +1,132 @@
|
||||
socat tunnel for encrypted rsync SST
|
||||
====================================
|
||||
|
||||
`wsrep_sst_rsync_tunnel` is an extension of the rsync-based [SST](http://galeracluster.com/documentation-webpages/glossary.html#term-state-snapshot-transfer)
|
||||
implementation that ships with mariadb. Its purpose is to encrypt
|
||||
communication between the donor and the joiner during an SST.
|
||||
|
||||
Encryption is implemented by means of a socat tunnel, using OPENSSL
|
||||
addresses. It can be configured via the regular openssl flags exposed
|
||||
by socat.
|
||||
|
||||
|
||||
## How to configure the script
|
||||
|
||||
This SST script can configured by setting a few keys in your favorite
|
||||
mariadb option file in addition to the usual galera settings.
|
||||
|
||||
[mysqld]
|
||||
...
|
||||
bind_address=<node-name>
|
||||
wsrep_sst_method=rsync_tunnel
|
||||
...
|
||||
|
||||
[sst]
|
||||
tca=/path/to/your/ca-file.crt
|
||||
tcert=/path/to/node/certificate.crt
|
||||
tkey=/path/to/node/key.key
|
||||
sockopt=<openssl-address-options-as-per-socat-manual>
|
||||
|
||||
When a joiner node requests an SST, `wsrep_sst_rsync_tunnel` uses
|
||||
socat to listen to incoming SSL connections on port 4444 in lieu of
|
||||
the original rsync daemon. Received data will be forwarded to the
|
||||
rscynd daemon started locally to replicate the database.
|
||||
|
||||
When a donor node serves the SST, `wsrep_sst_rsync_tunnel` makes
|
||||
a series of rsync calls that target a locally started socat daemon.
|
||||
The daemon tunnels all rsync traffic into an encrypted SSL connection
|
||||
that targets the joiner's end of the socat tunnel.
|
||||
|
||||
Encryption parameters are specified under the `[sst]` group in the
|
||||
mariadb option file, where `tkey` and `tcert` are respectively the key
|
||||
and the certificate that are used by both sides of the socat tunnel.
|
||||
Each node typically has a different key and cert. Both key and
|
||||
certificate can be combined into a single PEM file and referenced by
|
||||
`tcert`. Option `tca` holds a list of the trusted signing
|
||||
certificates.
|
||||
|
||||
In case you need to tweak the creation of the SSL connection, you can
|
||||
pass valid socat options (as per socat manual) via the `sockopt` key.
|
||||
For debugging purpose, the exact socat command that is being executed
|
||||
shows up in the mariadb log file.
|
||||
|
||||
Note that socat verifies that the certificate's commonName matches
|
||||
that of the host that is being targeted. The target name comes from
|
||||
the value configured in `bind_address`, so it's important that it
|
||||
matches the certificate's commonName. An IP address can be used for
|
||||
`bind_address`, but you may get into trouble in case different
|
||||
hostnames resolve to the same IP (e.g. multiple networks per host).
|
||||
|
||||
|
||||
## Examples of use
|
||||
|
||||
Suppose you're running a 3-node galera cluster
|
||||
`node1.my.cluster`, `node2.my.cluster`, `node3.my.cluster`.
|
||||
|
||||
### Scenario: using self-signed certificates
|
||||
|
||||
On each node, create a key and a certificate, and bundle them into a
|
||||
single PEM file. For instance on `node1.my.cluster`:
|
||||
|
||||
openssl genrsa -out /tls/mysql-$(hostname -f).key 2048
|
||||
openssl req -new -key /tls/mysql-$(hostname -f).key -x509 -days 365000 -subj "/CN=$(hostname -f)" -out /tls/mysql-$(hostname -f).crt -batch
|
||||
cat /tls/mysql-$(hostname -f).key /tls/mysql-$(hostname -f).crt > /tls/mysql.pem
|
||||
|
||||
Then, on each node, create a cafile that will contain all the certs to
|
||||
trust:
|
||||
|
||||
for n in node1.my.cluster node2.my.cluster node3.my.cluster; do
|
||||
ssh $n 'cat /tls/mysql-$(hostname -f).crt' >> /tls/all-mysql.crt
|
||||
done
|
||||
|
||||
Once you have those two files on each host, you can configure the SST
|
||||
appropriately. For instance from `/etc/my.cnf.d/galera.cnf`:
|
||||
|
||||
[mysqld]
|
||||
...
|
||||
|
||||
[sst]
|
||||
tca=/tls/all-mysql.crt
|
||||
tcert=/tls/mysql.pem
|
||||
|
||||
### Scenario: using self-signed certificates, without verification
|
||||
|
||||
By default, when socat tries to establish a SSL connection to a peer,
|
||||
it also verifies that it can trust the peer's certificate. If for some
|
||||
reason you need to disable that feature, you can amend the previous
|
||||
configuration with a sockopt option:
|
||||
|
||||
[mysqld]
|
||||
...
|
||||
|
||||
[sst]
|
||||
tca=/tls/all-mysql.crt
|
||||
tcert=/tls/mysql.pem
|
||||
sockopt="verify=0"
|
||||
|
||||
The associated sockopt value is passed to socat when
|
||||
the donor or the joiner configures his part of the tunnel.
|
||||
|
||||
Note: please do not do so in production, this is inherently insecure
|
||||
as you will not verify the identity of the peer you're connecting to!
|
||||
|
||||
### Scenario: using certificates from a CA
|
||||
|
||||
Suppose you have a FreeIPA service which generated a key file and a
|
||||
certificate file for the three galera nodes, respectively located at
|
||||
/tls/mysql.key and /tls/mysql.crt.
|
||||
|
||||
Assuming that the certificate for the FreeIPA server is available at
|
||||
/etc/ipa/ca.crt, you can configure you galera servers as follows:
|
||||
|
||||
[sst]
|
||||
tca=/etc/ipa/ca.crt
|
||||
tcert=/tls/mysql.crt
|
||||
tkey=/tls/mysql.key
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2017 [Damien Ciabrini](https://github.com/dciabrin).
|
||||
This work is derived from the original `wsrep_rsync_sst`, copyright
|
||||
© 2010-2014 [Codership Oy](https://github.com/codership).
|
||||
Released under the GNU GPLv2.
|
@ -1,32 +0,0 @@
|
||||
mysqladmin crash on execution of below command:
|
||||
|
||||
#> mysqladmin -u root -p
|
||||
...
|
||||
Segmentation fault (core dumped)
|
||||
|
||||
This is probably caused by memory corruption based on working with temp_argv[-1].
|
||||
|
||||
RHBZ: #1207041
|
||||
Upstream report: https://mariadb.atlassian.net/browse/MDEV-7883
|
||||
|
||||
---
|
||||
client/mysqladmin.cc | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
|
||||
index ffdc73f..cb0c558 100644
|
||||
--- a/client/mysqladmin.cc
|
||||
+++ b/client/mysqladmin.cc
|
||||
@@ -1361,7 +1361,8 @@ static char **mask_password(int argc, char ***argv)
|
||||
}
|
||||
argc--;
|
||||
}
|
||||
- temp_argv[argc]= my_strdup((*argv)[argc], MYF(MY_FAE));
|
||||
+ if (argc >= 0)
|
||||
+ temp_argv[argc]= my_strdup((*argv)[argc], MYF(MY_FAE));
|
||||
return(temp_argv);
|
||||
}
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
13
database/mariadb/centos/files/mariadb-annocheck.patch
Normal file
13
database/mariadb/centos/files/mariadb-annocheck.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Harden the "hardened" flags even more to comply with RHEL8 security rules
|
||||
|
||||
--- mariadb-10.3.10/CMakeLists.txt 2018-10-02 11:45:39.000000000 +0200
|
||||
+++ mariadb-10.3.10/CMakeLists.txt_patched 2018-11-08 03:48:01.713969313 +0100
|
||||
@@ -226,7 +226,7 @@ IF(NOT WITH_TSAN)
|
||||
# security-enhancing flags
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now")
|
||||
- MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector --param=ssp-buffer-size=4")
|
||||
+ MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector-strong --param=ssp-buffer-size=4")
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
|
||||
ENDIF()
|
||||
ENDIF()
|
@ -1,24 +0,0 @@
|
||||
Don't guess basedir in mysql_config; we place it under _libdir because
|
||||
of multilib conflicts, so use rather configured @prefix@ path directly.
|
||||
|
||||
---
|
||||
scripts/mysql_config.sh | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
|
||||
index 52f6d56..df63365 100644
|
||||
--- a/scripts/mysql_config.sh
|
||||
+++ b/scripts/mysql_config.sh
|
||||
@@ -76,8 +76,7 @@ get_full_path ()
|
||||
|
||||
me=`get_full_path $0`
|
||||
|
||||
-# Script might have been renamed but assume mysql_<something>config<something>
|
||||
-basedir=`echo $me | sed -e 's;/bin/mysql_.*config.*;;'`
|
||||
+basedir='@prefix@'
|
||||
|
||||
ldata='@localstatedir@'
|
||||
execdir='@libexecdir@'
|
||||
--
|
||||
1.9.1
|
||||
|
19
database/mariadb/centos/files/mariadb-covscan.patch
Normal file
19
database/mariadb/centos/files/mariadb-covscan.patch
Normal file
@ -0,0 +1,19 @@
|
||||
Error: SHELLCHECK_WARNING:
|
||||
/usr/bin/mysql_install_db:431:10: warning: Remove backticks to avoid executing output. [SC2092]
|
||||
# 429| if test ! -d "$dir"
|
||||
# 430| then
|
||||
# 431|-> if ! `mkdir -p "$dir"`
|
||||
# 432| then
|
||||
# 433| echo "Fatal error Can't create database directory '$dir'"
|
||||
--- mariadb-10.3.10/scripts/mysql_install_db.sh 2018-10-02 11:45:42.000000000 +0200
|
||||
+++ mariadb-10.3.10/scripts/mysql_install_db.sh_patched 2018-11-14 10:06:54.868469138 +0100
|
||||
@@ -428,7 +428,7 @@ for dir in "$ldata" "$ldata/mysql"
|
||||
do
|
||||
if test ! -d "$dir"
|
||||
then
|
||||
- if ! `mkdir -p "$dir"`
|
||||
+ if ! mkdir -p "$dir"
|
||||
then
|
||||
echo "Fatal error Can't create database directory '$dir'"
|
||||
link_to_help
|
||||
|
@ -1,26 +0,0 @@
|
||||
---
|
||||
include/my_sys.h | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
diff --git a/include/my_sys.h b/include/my_sys.h
|
||||
index 110a2ee..a90ac5c 100644
|
||||
--- a/include/my_sys.h
|
||||
+++ b/include/my_sys.h
|
||||
@@ -212,13 +212,7 @@
|
||||
#define my_safe_afree(ptr, size) my_afree(ptr)
|
||||
#endif /* HAVE_ALLOCA */
|
||||
|
||||
-#ifndef errno /* did we already get it? */
|
||||
-#ifdef HAVE_ERRNO_AS_DEFINE
|
||||
-#include <errno.h> /* errno is a define */
|
||||
-#else
|
||||
-extern int errno; /* declare errno */
|
||||
-#endif
|
||||
-#endif /* #ifndef errno */
|
||||
+#include <errno.h> /* errno is a define */
|
||||
extern char *home_dir; /* Home directory for user */
|
||||
extern MYSQL_PLUGIN_IMPORT char *mysql_data_home;
|
||||
extern const char *my_progname; /* program-name (printed in errors) */
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,72 +0,0 @@
|
||||
---
|
||||
support-files/my-huge.cnf.sh | 1 +
|
||||
support-files/my-innodb-heavy-4G.cnf.sh | 2 +-
|
||||
support-files/my-large.cnf.sh | 1 +
|
||||
support-files/my-medium.cnf.sh | 1 +
|
||||
support-files/my-small.cnf.sh | 1 +
|
||||
5 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
|
||||
index 4e08348..d8bf29e 100644
|
||||
--- a/support-files/my-huge.cnf.sh
|
||||
+++ b/support-files/my-huge.cnf.sh
|
||||
@@ -25,6 +25,7 @@ socket = @MYSQL_UNIX_ADDR@
|
||||
|
||||
# The MySQL server
|
||||
[mysqld]
|
||||
+log-error = @LOG_LOCATION@
|
||||
port = @MYSQL_TCP_PORT@
|
||||
socket = @MYSQL_UNIX_ADDR@
|
||||
skip-external-locking
|
||||
diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
|
||||
index 2590ff5..85fd33a 100644
|
||||
--- a/support-files/my-innodb-heavy-4G.cnf.sh
|
||||
+++ b/support-files/my-innodb-heavy-4G.cnf.sh
|
||||
@@ -42,7 +42,7 @@ socket = @MYSQL_UNIX_ADDR@
|
||||
# The MariaDB server
|
||||
#
|
||||
[mysqld]
|
||||
-
|
||||
+log-error = @LOG_LOCATION@
|
||||
# generic configuration options
|
||||
port = @MYSQL_TCP_PORT@
|
||||
socket = @MYSQL_UNIX_ADDR@
|
||||
diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
|
||||
index 6f8dab0..e8c5f74 100644
|
||||
--- a/support-files/my-large.cnf.sh
|
||||
+++ b/support-files/my-large.cnf.sh
|
||||
@@ -25,6 +25,7 @@ socket = @MYSQL_UNIX_ADDR@
|
||||
|
||||
# The MariaDB server
|
||||
[mysqld]
|
||||
+log-error = @LOG_LOCATION@
|
||||
port = @MYSQL_TCP_PORT@
|
||||
socket = @MYSQL_UNIX_ADDR@
|
||||
skip-external-locking
|
||||
diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh
|
||||
index 19ab8df..fc8fc78 100644
|
||||
--- a/support-files/my-medium.cnf.sh
|
||||
+++ b/support-files/my-medium.cnf.sh
|
||||
@@ -26,6 +26,7 @@ socket = @MYSQL_UNIX_ADDR@
|
||||
|
||||
# The MariaDB server
|
||||
[mysqld]
|
||||
+log-error = @LOG_LOCATION@
|
||||
port = @MYSQL_TCP_PORT@
|
||||
socket = @MYSQL_UNIX_ADDR@
|
||||
skip-external-locking
|
||||
diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
|
||||
index 8c78072..6777431 100644
|
||||
--- a/support-files/my-small.cnf.sh
|
||||
+++ b/support-files/my-small.cnf.sh
|
||||
@@ -24,6 +24,7 @@ socket = @MYSQL_UNIX_ADDR@
|
||||
|
||||
# The MySQL server
|
||||
[mysqld]
|
||||
+log-error = @LOG_LOCATION@
|
||||
port = @MYSQL_TCP_PORT@
|
||||
socket = @MYSQL_UNIX_ADDR@
|
||||
skip-external-locking
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,49 +0,0 @@
|
||||
Upstream chooses to install INFO_SRC and INFO_BIN into the docs dir, which
|
||||
breaks at least two packaging commandments, so we put them into $libdir
|
||||
instead. That means we have to hack the file_contents regression test
|
||||
to know about this.
|
||||
|
||||
Recommendation they change is at http://bugs.mysql.com/bug.php?id=61425
|
||||
|
||||
---
|
||||
mysql-test/t/file_contents.test | 13 ++++++++++--
|
||||
1 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test
|
||||
index 4734a02..a892297 100644
|
||||
--- a/mysql-test/t/file_contents.test
|
||||
+++ b/mysql-test/t/file_contents.test
|
||||
@@ -11,7 +11,7 @@
|
||||
--perl
|
||||
print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n";
|
||||
$dir_bin = $ENV{'MYSQL_BINDIR'};
|
||||
-if ($dir_bin eq '/usr/') {
|
||||
+if ($dir_bin =~ '.*/usr/$') {
|
||||
# RPM package
|
||||
$dir_docs = $dir_bin;
|
||||
$dir_docs =~ s|/lib|/share/doc|;
|
||||
@@ -22,7 +22,7 @@ if ($dir_bin eq '/usr/') {
|
||||
# RedHat: version number in directory name
|
||||
$dir_docs = glob "$dir_docs/MariaDB-server*";
|
||||
}
|
||||
-} elsif ($dir_bin eq '/usr') {
|
||||
+} elsif ($dir_bin =~ '.*/usr$') {
|
||||
# RPM build during development
|
||||
$dir_docs = "$dir_bin/share/doc";
|
||||
if(-d "$dir_docs/packages") {
|
||||
@@ -32,6 +32,15 @@ if ($dir_bin eq '/usr/') {
|
||||
# RedHat/Debian: version number in directory name
|
||||
$dir_docs = glob "$dir_docs/mariadb-server-*";
|
||||
$dir_docs = glob "$dir_docs/MariaDB-server*" unless -d $dir_docs;
|
||||
+
|
||||
+ # All the above is entirely wacko, because these files are not docs;
|
||||
+ # they should be kept in libdir instead. mtr does not provide a nice
|
||||
+ # way to find libdir though, so we have to kluge it like this:
|
||||
+ if (-d "$dir_bin/lib64/mysql") {
|
||||
+ $dir_docs = "$dir_bin/lib64/mysql";
|
||||
+ } else {
|
||||
+ $dir_docs = "$dir_bin/lib/mysql";
|
||||
+ }
|
||||
}
|
||||
# Slackware
|
||||
$dir_docs = glob "$dir_bin/doc/mariadb-[0-9]*" unless -d $dir_docs;
|
@ -1,21 +0,0 @@
|
||||
---
|
||||
support-files/wsrep.cnf.sh | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/support-files/wsrep.cnf.sh b/support-files/wsrep.cnf.sh
|
||||
index a539085..51ce3dc 100644
|
||||
--- a/support-files/wsrep.cnf.sh
|
||||
+++ b/support-files/wsrep.cnf.sh
|
||||
@@ -30,6 +30,9 @@ bind-address=0.0.0.0
|
||||
## WSREP options
|
||||
##
|
||||
|
||||
+# Enable wsrep
|
||||
+wsrep_on=1
|
||||
+
|
||||
# Full path to wsrep provider library or 'none'
|
||||
wsrep_provider=none
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,49 +0,0 @@
|
||||
Use configured value instead of hardcoded path
|
||||
|
||||
---
|
||||
scripts/mysql_install_db.pl.in | 2 +-
|
||||
scripts/mysql_install_db.sh | 8 ++++----
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
|
||||
index 9d2c1f6..0accdd1 100644
|
||||
--- a/scripts/mysql_install_db.pl.in
|
||||
+++ b/scripts/mysql_install_db.pl.in
|
||||
@@ -320,7 +320,7 @@ elsif ( $opt->{basedir} )
|
||||
find_in_basedir($opt,"file","mysqld-nt",
|
||||
"bin"); # ,"sql"
|
||||
$srcpkgdatadir = find_in_basedir($opt,"dir","fill_help_tables.sql",
|
||||
- "share","share/mysql"); # ,"scripts"
|
||||
+ "share","@INSTALL_MYSQLSHAREDIR@"); # ,"scripts"
|
||||
$buildpkgdir = $srcpkgdatadir;
|
||||
$scriptdir = "$opt->{basedir}/scripts";
|
||||
}
|
||||
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
|
||||
index 364cc4f..eaa7a89 100644
|
||||
--- a/scripts/mysql_install_db.sh
|
||||
+++ b/scripts/mysql_install_db.sh
|
||||
@@ -311,17 +311,17 @@ then
|
||||
cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin
|
||||
exit 1
|
||||
fi
|
||||
- langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english`
|
||||
+ langdir=`find_in_basedir --dir errmsg.sys share/english @INSTALL_MYSQLSHAREDIR@/english`
|
||||
if test -z "$langdir"
|
||||
then
|
||||
- cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english
|
||||
+ cannot_find_file errmsg.sys $basedir/share/english $basedir/@INSTALL_MYSQLSHAREDIR@/english
|
||||
exit 1
|
||||
fi
|
||||
- srcpkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql`
|
||||
+ srcpkgdatadir=`find_in_basedir --dir fill_help_tables.sql share @INSTALL_MYSQLSHAREDIR@`
|
||||
buildpkgdatadir=$srcpkgdatadir
|
||||
if test -z "$srcpkgdatadir"
|
||||
then
|
||||
- cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql
|
||||
+ cannot_find_file fill_help_tables.sql $basedir/share $basedir/@INSTALL_MYSQLSHAREDIR@
|
||||
exit 1
|
||||
fi
|
||||
scriptdir="$basedir/scripts"
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,62 +0,0 @@
|
||||
Improve the documentation that will be installed in the mysql-test RPM.
|
||||
|
||||
---
|
||||
mysql-test/README | 36 +++++++++++++++++++++++++-----------
|
||||
1 file changed, 25 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/mysql-test/README b/mysql-test/README
|
||||
index 0fba1cc..2e756e9 100644
|
||||
--- a/mysql-test/README
|
||||
+++ b/mysql-test/README
|
||||
@@ -1,15 +1,28 @@
|
||||
-This directory contains a test suite for the MySQL daemon. To run
|
||||
-the currently existing test cases, simply execute ./mysql-test-run in
|
||||
-this directory. It will fire up the newly built mysqld and test it.
|
||||
+This directory contains a test suite for the MariaDB daemon. To run
|
||||
+the currently existing test cases, execute ./mysql-test-run in
|
||||
+this directory.
|
||||
|
||||
-Note that you do not have to have to do "make install", and you could
|
||||
-actually have a co-existing MySQL installation. The tests will not
|
||||
-conflict with it. To run the test suite in a source directory, you
|
||||
-must do make first.
|
||||
+For use in Red Hat distributions, you should run the script as user mysql,
|
||||
+who is created with nologin shell however, so the best bet is something like
|
||||
+ $ su -
|
||||
+ # cd /usr/share/mysql-test
|
||||
+ # su -s /bin/bash mysql -c "./mysql-test-run --skip-test-list=rh-skipped-tests.list"
|
||||
|
||||
-All tests must pass. If one or more of them fail on your system, please
|
||||
-read the following manual section for instructions on how to report the
|
||||
-problem:
|
||||
+This will use the installed mysql executables, but will run a private copy
|
||||
+of the server process (using data files within /usr/share/mysql-test),
|
||||
+so you need not start the mysqld service beforehand.
|
||||
+
|
||||
+The "--skip-test-list=rh-skipped-tests.list" option excludes tests that are
|
||||
+known to fail on one or more Red-Hat-supported platforms. You can omit it
|
||||
+if you want to check whether such failures occur for you. Documentation
|
||||
+about the reasons for omitting such tests can be found in the file
|
||||
+rh-skipped-tests.list.
|
||||
+
|
||||
+To clean up afterwards, remove the created "var" subdirectory, eg
|
||||
+ # su -s /bin/bash - mysql -c "rm -rf /usr/share/mysql-test/var"
|
||||
+
|
||||
+If one or more tests fail on your system, please read the following manual
|
||||
+section for instructions on how to report the problem:
|
||||
|
||||
https://mariadb.com/kb/en/reporting-bugs
|
||||
|
||||
@@ -26,7 +39,8 @@ other relevant options.
|
||||
|
||||
With no test cases named on the command line, mysql-test-run falls back
|
||||
to the normal "non-extern" behavior. The reason for this is that some
|
||||
-tests cannot run with an external server.
|
||||
+tests cannot run with an external server (because they need to control the
|
||||
+options with which the server is started).
|
||||
|
||||
You can create your own test cases. To create a test case, create a new
|
||||
file in the t subdirectory using a text editor. The file should have a .test
|
||||
--
|
||||
1.9.1
|
||||
|
@ -12,69 +12,66 @@ Adjust the mysql-log-rotate script in several ways:
|
||||
is low-volume and so rotation is not critical functionality.
|
||||
|
||||
See discussions at RH bugs 799735, 547007
|
||||
* Note they are from Fedora 15 / 16
|
||||
|
||||
---
|
||||
support-files/mysql-log-rotate.sh | 44 ++++++++++++++++++++-------------------
|
||||
1 files changed, 23 insertions(+), 21 deletions(-)
|
||||
Update 3/2017
|
||||
* it would be big unexpected change for anyone upgrading, if we start shipping it now.
|
||||
Maybe it is good candidate for shipping with MariaDB 10.2 ?
|
||||
* the 'mysqladmin flush logs' doesn´t guarantee, no entries are lost
|
||||
during flushing, the operation is not atomic.
|
||||
We should not ship it in that state
|
||||
|
||||
diff --git a/support-files/mysql-log-rotate.sh b/support-files/mysql-log-rotate.sh
|
||||
index 5d1b30b..425c591 100644
|
||||
--- a/support-files/mysql-log-rotate.sh
|
||||
+++ b/support-files/mysql-log-rotate.sh
|
||||
@@ -1,9 +1,9 @@
|
||||
Update 6/2018
|
||||
* the SIGHUP causes server to flush all logs. No password admin needed, the only constraint is
|
||||
beeing able to send the SIGHUP to the process and read the mysqld pid file, which root can.
|
||||
* Submited as PR: https://github.com/MariaDB/server/pull/807
|
||||
|
||||
--- mariadb-10.3.7/support-files/mysql-log-rotate.sh 2018-05-23 22:38:46.000000000 +0200
|
||||
+++ mariadb-10.3.7/support-files/mysql-log-rotate.sh_patched 2018-06-27 12:11:23.705719826 +0200
|
||||
@@ -1,25 +1,12 @@
|
||||
# This logname can be set in /etc/my.cnf
|
||||
-# by setting the variable "err-log"
|
||||
# by setting the variable "err-log"
|
||||
-# in the [safe_mysqld] section as follows:
|
||||
+# by setting the variable "log-error"
|
||||
+# in the [mysqld_safe] section as follows:
|
||||
+# in the [mysqld] section as follows:
|
||||
#
|
||||
-# [safe_mysqld]
|
||||
-# err-log=@localstatedir@/mysqld.log
|
||||
+# [mysqld_safe]
|
||||
+# log-error=@LOG_LOCATION@
|
||||
#
|
||||
# If the root user has a password you have to create a
|
||||
# /root/.my.cnf configuration file with the following
|
||||
@@ -18,20 +18,22 @@
|
||||
# ATTENTION: This /root/.my.cnf should be readable ONLY
|
||||
# for root !
|
||||
-#
|
||||
-# If the root user has a password you have to create a
|
||||
-# /root/.my.cnf configuration file with the following
|
||||
-# content:
|
||||
-#
|
||||
-# [mysqladmin]
|
||||
-# password = <secret>
|
||||
-# user= root
|
||||
-#
|
||||
-# where "<secret>" is the password.
|
||||
-#
|
||||
-# ATTENTION: This /root/.my.cnf should be readable ONLY
|
||||
-# for root !
|
||||
+# [mysqld]
|
||||
+# log_error=@LOG_LOCATION@
|
||||
|
||||
-@localstatedir@/mysqld.log {
|
||||
- # create 600 mysql mysql
|
||||
- notifempty
|
||||
- daily
|
||||
- rotate 3
|
||||
- missingok
|
||||
- compress
|
||||
- postrotate
|
||||
- # just if mysqld is really running
|
||||
+@LOG_LOCATION@ {
|
||||
+ create 600 mysql mysql
|
||||
notifempty
|
||||
daily
|
||||
rotate 3
|
||||
@@ -27,11 +14,9 @@
|
||||
compress
|
||||
postrotate
|
||||
# just if mysqld is really running
|
||||
- if test -x @bindir@/mysqladmin && \
|
||||
- @bindir@/mysqladmin ping &>/dev/null
|
||||
- then
|
||||
- @bindir@/mysqladmin --local flush-error-log \
|
||||
- flush-engine-log flush-general-log flush-slow-log
|
||||
- fi
|
||||
- endscript
|
||||
-}
|
||||
+# Then, un-comment the following lines to enable rotation of mysql's log file:
|
||||
+
|
||||
+#@LOG_LOCATION@ {
|
||||
+# # create 600 mysql mysql
|
||||
+# notifempty
|
||||
+# daily
|
||||
+# rotate 3
|
||||
+# missingok
|
||||
+# compress
|
||||
+# postrotate
|
||||
+# # just if mysqld is really running
|
||||
+# if test -x @bindir@/mysqladmin && \
|
||||
+# @bindir@/mysqladmin ping &>/dev/null
|
||||
+# then
|
||||
+# @bindir@/mysqladmin --local flush-error-log \
|
||||
+# flush-engine-log flush-general-log flush-slow-log
|
||||
+# fi
|
||||
+# endscript
|
||||
+#}
|
||||
--
|
||||
1.9.1
|
||||
|
||||
+ if [ -e @PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid ]
|
||||
+ then
|
||||
+ kill -1 $(<@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid)
|
||||
+ fi
|
||||
endscript
|
||||
}
|
||||
|
@ -1,24 +0,0 @@
|
||||
---
|
||||
scripts/mysql_install_db.pl.in | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
|
||||
index 0accdd1..3ab2786 100644
|
||||
--- a/scripts/mysql_install_db.pl.in
|
||||
+++ b/scripts/mysql_install_db.pl.in
|
||||
@@ -399,10 +399,10 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
-# Create database directories mysql & test
|
||||
+# Create database directories mysql
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
-foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
|
||||
+foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql" )
|
||||
{
|
||||
# FIXME not really the same as original "mkdir -p", but ok?
|
||||
mkdir($dir, 0700) unless -d $dir;
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,13 +1,7 @@
|
||||
---
|
||||
support-files/CMakeLists.txt | 1 +
|
||||
support-files/rpm/server.cnf | 9 +++++++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
|
||||
index 71e9b3f..5f3b2a6 100644
|
||||
--- a/support-files/CMakeLists.txt
|
||||
+++ b/support-files/CMakeLists.txt
|
||||
@@ -81,6 +81,7 @@ IF(UNIX)
|
||||
diff -up mariadb-10.1.8/support-files/CMakeLists.txt.p9 mariadb-10.1.8/support-files/CMakeLists.txt
|
||||
--- mariadb-10.1.8/support-files/CMakeLists.txt.p9 2015-11-03 11:38:46.029139464 +0100
|
||||
+++ mariadb-10.1.8/support-files/CMakeLists.txt 2015-11-03 11:41:07.107605055 +0100
|
||||
@@ -62,6 +62,7 @@ IF(UNIX)
|
||||
ENDIF()
|
||||
|
||||
CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY)
|
||||
@ -15,10 +9,9 @@ index 71e9b3f..5f3b2a6 100644
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_SHAREDIR}/pkgconfig COMPONENT Development)
|
||||
|
||||
INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
|
||||
diff --git a/support-files/rpm/server.cnf b/support-files/rpm/server.cnf
|
||||
index 9682d2b..6f398d4 100644
|
||||
--- a/support-files/rpm/server.cnf
|
||||
+++ b/support-files/rpm/server.cnf
|
||||
diff -up mariadb-10.1.8/support-files/rpm/server.cnf.p9 mariadb-10.1.8/support-files/rpm/server.cnf
|
||||
--- mariadb-10.1.8/support-files/rpm/server.cnf.p9 2015-10-15 17:44:19.000000000 +0200
|
||||
+++ mariadb-10.1.8/support-files/rpm/server.cnf 2015-11-03 11:38:25.228070808 +0100
|
||||
@@ -9,7 +9,16 @@
|
||||
[server]
|
||||
|
||||
@ -36,6 +29,3 @@ index 9682d2b..6f398d4 100644
|
||||
|
||||
#
|
||||
# * Galera-related settings
|
||||
--
|
||||
1.9.1
|
||||
|
||||
|
20
database/mariadb/centos/files/mariadb-pcdir.patch
Normal file
20
database/mariadb/centos/files/mariadb-pcdir.patch
Normal file
@ -0,0 +1,20 @@
|
||||
Use PCDIR CMake option, if configured
|
||||
|
||||
Upstream install the server pkgconfig file into arch-independent directory
|
||||
Reported to upstream as: https://jira.mariadb.org/browse/MDEV-14340
|
||||
|
||||
--- mariadb-10.3.12/support-files/CMakeLists.txt 2019-03-20 15:25:53.423283135 +0100
|
||||
+++ mariadb-10.3.12/support-files/CMakeLists.txt_patched 2019-03-20 15:38:56.372819958 +0100
|
||||
@@ -82,7 +82,12 @@ IF(UNIX)
|
||||
|
||||
CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY)
|
||||
CONFIGURE_FILE(rpm/server.cnf ${CMAKE_CURRENT_BINARY_DIR}/rpm/server.cnf @ONLY)
|
||||
+IF(INSTALL_PCDIR)
|
||||
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_PCDIR} COMPONENT Development)
|
||||
+ELSE()
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_SHAREDIR}/pkgconfig COMPONENT Development)
|
||||
+ENDIF()
|
||||
+
|
||||
|
||||
INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
|
||||
|
@ -1,34 +0,0 @@
|
||||
---
|
||||
scripts/mysqld_safe.sh | 2 +-
|
||||
support-files/mysql.server.sh | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
|
||||
index 5564f92..fe77d97 100644
|
||||
--- a/scripts/mysqld_safe.sh
|
||||
+++ b/scripts/mysqld_safe.sh
|
||||
@@ -756,7 +756,7 @@ if [ ! -d $mysql_unix_port_dir ]
|
||||
then
|
||||
if ! `mkdir -p $mysql_unix_port_dir`
|
||||
then
|
||||
- log_error "Fatal error Can't create database directory '$mysql_unix_port'"
|
||||
+ echo "Fatal error Can't create database directory '$mysql_unix_port'"
|
||||
exit 1
|
||||
fi
|
||||
chown $user $mysql_unix_port_dir
|
||||
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
|
||||
index ed0da3c..312f2b2 100644
|
||||
--- a/support-files/mysql.server.sh
|
||||
+++ b/support-files/mysql.server.sh
|
||||
@@ -296,7 +296,7 @@ case "$mode" in
|
||||
then
|
||||
# Give extra arguments to mysqld with the my.cnf file. This script
|
||||
# may be overwritten at next upgrade.
|
||||
- $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" &
|
||||
+ $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" >dev/null &
|
||||
wait_for_ready; return_value=$?
|
||||
|
||||
# Make lock for RedHat / SuSE
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,29 +1,25 @@
|
||||
---
|
||||
scripts/CMakeLists.txt | 29 +++++++++++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
We have some downstream patches and other scripts that include variables to
|
||||
be expanded by cmake. Cmake needs to know about them, so adding them manually.
|
||||
|
||||
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
|
||||
index 2f9c185..a6e4d49 100644
|
||||
--- a/scripts/CMakeLists.txt
|
||||
+++ b/scripts/CMakeLists.txt
|
||||
@@ -362,6 +362,35 @@ ELSE()
|
||||
--- mariadb-10.3.8/scripts/CMakeLists.txt 2018-07-02 09:34:11.000000000 +0200
|
||||
+++ mariadb-10.3.8/scripts/CMakeLists.txt_patched 2018-07-03 10:58:15.954670153 +0200
|
||||
@@ -361,6 +361,34 @@ ELSE()
|
||||
COMPONENT ${${file}_COMPONENT}
|
||||
)
|
||||
ENDFOREACH()
|
||||
|
||||
+
|
||||
+ # files for systemd
|
||||
+ SET(SYSTEMD_SCRIPTS
|
||||
+ mysql.tmpfiles.d
|
||||
+ mysql.service
|
||||
+ mysql@.service
|
||||
+ mysql-prepare-db-dir
|
||||
+ mysql-wait-ready
|
||||
+ mysql-wait-stop
|
||||
+ mysql-check-socket
|
||||
+ mysql-check-upgrade
|
||||
+ mysql-scripts-common
|
||||
+ mysql_config_multilib
|
||||
+ clustercheck
|
||||
+ mysql.init
|
||||
+ galera_new_cluster
|
||||
+ my.cnf
|
||||
+ )
|
||||
+ FOREACH(file ${SYSTEMD_SCRIPTS})
|
||||
@ -39,9 +35,6 @@ index 2f9c185..a6e4d49 100644
|
||||
+ ENDIF()
|
||||
+ ENDFOREACH()
|
||||
+
|
||||
FOREACH(file ${WSREP_SOURCE})
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
|
||||
--
|
||||
1.9.1
|
||||
|
||||
ENDIF()
|
||||
|
||||
# Install libgcc as mylibgcc.a
|
||||
|
1078
database/mariadb/centos/files/mariadb-spider_on_armv7hl.patch
Normal file
1078
database/mariadb/centos/files/mariadb-spider_on_armv7hl.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,30 +0,0 @@
|
||||
---
|
||||
mysql-test/r/ssl_8k_key.result | 4 ++--
|
||||
mysql-test/t/ssl_8k_key.test | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/mysql-test/r/ssl_8k_key.result b/mysql-test/r/ssl_8k_key.result
|
||||
index b33a1d2..ff9d0cc 100644
|
||||
--- a/mysql-test/r/ssl_8k_key.result
|
||||
+++ b/mysql-test/r/ssl_8k_key.result
|
||||
@@ -1,2 +1,2 @@
|
||||
-Variable_name Value
|
||||
-Ssl_cipher DHE-RSA-AES256-SHA
|
||||
+have_ssl
|
||||
+1
|
||||
diff --git a/mysql-test/t/ssl_8k_key.test b/mysql-test/t/ssl_8k_key.test
|
||||
index 27cffdc..4b81648 100644
|
||||
--- a/mysql-test/t/ssl_8k_key.test
|
||||
+++ b/mysql-test/t/ssl_8k_key.test
|
||||
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# Bug#29784 YaSSL assertion failure when reading 8k key.
|
||||
#
|
||||
---exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
|
||||
+--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher'" 2>&1
|
||||
|
||||
## This test file is for testing encrypted communication only, not other
|
||||
## encryption routines that the SSL library happens to provide!
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,40 +0,0 @@
|
||||
Remove overly optimistic definition of strmov() as stpcpy().
|
||||
|
||||
mysql uses this macro with overlapping source and destination strings,
|
||||
which is verboten per spec, and fails on some Red Hat platforms.
|
||||
Deleting the definition is sufficient to make it fall back to a
|
||||
byte-at-a-time copy loop, which should consistently give the
|
||||
expected behavior.
|
||||
|
||||
Note: the particular case that prompted this patch is reported and fixed
|
||||
at http://bugs.mysql.com/bug.php?id=48864. However, my faith in upstream's
|
||||
ability to detect this type of error is low, and I also see little evidence
|
||||
of any real performance gain from optimizing these calls. So I'm keeping
|
||||
this patch.
|
||||
|
||||
---
|
||||
include/m_string.h | 8 --------
|
||||
1 file changed, 8 deletions(-)
|
||||
|
||||
diff --git a/include/m_string.h b/include/m_string.h
|
||||
index 7437ea8..bb3ab57 100644
|
||||
--- a/include/m_string.h
|
||||
+++ b/include/m_string.h
|
||||
@@ -73,14 +73,6 @@
|
||||
extern void *(*my_str_realloc)(void *, size_t);
|
||||
extern void (*my_str_free)(void *);
|
||||
|
||||
-#ifdef DBUG_OFF
|
||||
-#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
|
||||
-#define strmov(A,B) __builtin_stpcpy((A),(B))
|
||||
-#elif defined(HAVE_STPCPY)
|
||||
-#define strmov(A,B) stpcpy((A),(B))
|
||||
-#endif
|
||||
-#endif
|
||||
-
|
||||
/* Declared in int2str() */
|
||||
extern const char _dig_vec_upper[];
|
||||
extern const char _dig_vec_lower[];
|
||||
--
|
||||
1.9.1
|
||||
|
@ -25,10 +25,10 @@ if test -e "$socketfile" ; then
|
||||
fi
|
||||
|
||||
# some process uses the socket file
|
||||
if fuser "$socketfile" &>/dev/null ; then
|
||||
socketpid=$(fuser "$socketfile" 2>/dev/null)
|
||||
response=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER --connect-timeout="${CHECKSOCKETTIMEOUT:-10}" ping 2>&1`
|
||||
if [ $? -eq 0 ] || echo "$response" | grep -q "Access denied for user" ; then
|
||||
echo "Is another MySQL daemon already running with the same unix socket?" >&2
|
||||
echo "Please, stop the process $socketpid or remove $socketfile manually to start the service." >&2
|
||||
echo "Please, stop the process using the socket $socketfile or remove the file manually to start the service." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -27,9 +27,9 @@ if [ $version -ne $thisversion ] ; then
|
||||
cat <<EOF >&2
|
||||
The datadir located at $datadir needs to be upgraded using 'mysql_upgrade' tool. This can be done using the following steps:
|
||||
|
||||
1. Back-up your data before with 'mysql_upgrade'
|
||||
2. Start the database daemon using 'service @DAEMON_NAME@ start'
|
||||
3. Run 'mysql_upgrade' with a database user that has sufficient privileges
|
||||
1. Back-up your data before with 'mysql_upgrade'
|
||||
2. Start the database daemon using 'service @DAEMON_NAME@ start'
|
||||
3. Run 'mysql_upgrade' with a database user that has sufficient privileges
|
||||
|
||||
Read more about 'mysql_upgrade' usage at:
|
||||
https://mariadb.com/kb/en/mariadb/documentation/sql-commands/table-commands/mysql_upgrade/
|
||||
|
@ -1,26 +0,0 @@
|
||||
/* simple test program to see if we can link the embedded server library */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "mysql.h"
|
||||
|
||||
MYSQL *mysql;
|
||||
|
||||
static char *server_options[] = \
|
||||
{ "mysql_test", "--defaults-file=my.cnf", NULL };
|
||||
int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
|
||||
|
||||
static char *server_groups[] = { "libmysqld_server",
|
||||
"libmysqld_client", NULL };
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
mysql_library_init(num_elements, server_options, server_groups);
|
||||
mysql = mysql_init(NULL);
|
||||
mysql_close(mysql);
|
||||
mysql_library_end();
|
||||
|
||||
return 0;
|
||||
}
|
@ -5,24 +5,27 @@
|
||||
|
||||
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
|
||||
|
||||
export LC_ALL=C
|
||||
|
||||
# Returns content of the specified directory
|
||||
# If listing files fails, fake-file is returned so which means
|
||||
# we'll behave like there was some data initialized
|
||||
# Some files or directories are fine to be there, so those are
|
||||
# explicitly removed from the listing
|
||||
# @param <dir> datadir
|
||||
ls_check_datadir ()
|
||||
list_datadir ()
|
||||
{
|
||||
ls -A "$1" 2>/dev/null
|
||||
test $? -eq 0 || echo "fake-file"
|
||||
( ls -1A "$1" 2>/dev/null || echo "fake-file" ) | grep -v \
|
||||
-e '^lost+found$' \
|
||||
-e '\.err$' \
|
||||
-e '^.bash_history$'
|
||||
}
|
||||
|
||||
# Checks whether datadir should be initialized
|
||||
# @param <dir> datadir
|
||||
should_initialize ()
|
||||
{
|
||||
case `ls_check_datadir "$1"` in
|
||||
""|lost+found|*.err) true ;;
|
||||
*) false ;;
|
||||
esac
|
||||
test -z "$(list_datadir "$1")"
|
||||
}
|
||||
|
||||
# If two args given first is user, second is group
|
||||
@ -52,24 +55,23 @@ else
|
||||
fi
|
||||
|
||||
# Set up the errlogfile with appropriate permissions
|
||||
touch "$errlogfile"
|
||||
ret=$?
|
||||
# Provide some advice if the log file cannot be touched
|
||||
if [ $ret -ne 0 ] ; then
|
||||
errlogdir=$(dirname $errlogfile)
|
||||
if [ ! -e "$errlogfile" -a ! -h "$errlogfile" -a x$(dirname "$errlogfile") = "x/var/log" ]; then
|
||||
case $(basename "$errlogfile") in
|
||||
mysql*.log|mariadb*.log) install /dev/null -m0640 -o$myuser -g$mygroup "$errlogfile" ;;
|
||||
*) ;;
|
||||
esac
|
||||
else
|
||||
# Provide some advice if the log file cannot be created by this script
|
||||
errlogdir=$(dirname "$errlogfile")
|
||||
if ! [ -d "$errlogdir" ] ; then
|
||||
echo "The directory $errlogdir does not exist."
|
||||
elif [ -f "$errlogfile" ] ; then
|
||||
echo "The log file $errlogfile cannot be touched, please, fix its permissions."
|
||||
else
|
||||
echo "The log file $errlogfile could not be created."
|
||||
echo "The directory $errlogdir does not exist." >&2
|
||||
exit 1
|
||||
elif [ -e "$errlogfile" -a ! -w "$errlogfile" ] ; then
|
||||
echo "The log file $errlogfile cannot be written, please, fix its permissions." >&2
|
||||
echo "The daemon will be run under $myuser:$mygroup" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "The daemon will be run under $myuser:$mygroup"
|
||||
exit 1
|
||||
fi
|
||||
chown "$myuser:$mygroup" "$errlogfile"
|
||||
chmod 0640 "$errlogfile"
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
|
||||
|
||||
# Make the data directory if doesn't exist or empty
|
||||
if should_initialize "$datadir" ; then
|
||||
@ -83,14 +85,14 @@ if should_initialize "$datadir" ; then
|
||||
[ -x /sbin/restorecon ] && /sbin/restorecon "$datadir"
|
||||
|
||||
# Now create the database
|
||||
echo "Initializing @NICE_PROJECT_NAME@ database"
|
||||
echo "Initializing @NICE_PROJECT_NAME@ database" >&2
|
||||
# Avoiding deletion of files not created by mysql_install_db is
|
||||
# guarded by time check and sleep should help work-arounded
|
||||
# potential issues on systems with 1 second resolution timestamps
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1335849#c19
|
||||
INITDB_TIMESTAMP=`LANG=C date -u`
|
||||
sleep 1
|
||||
@bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser"
|
||||
@bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser" --skip-test-db >&2
|
||||
ret=$?
|
||||
if [ $ret -ne 0 ] ; then
|
||||
echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2
|
||||
@ -113,8 +115,6 @@ if should_initialize "$datadir" ; then
|
||||
fi
|
||||
# upgrade does not need to be run on a fresh datadir
|
||||
echo "@VERSION@-MariaDB" >"$datadir/mysql_upgrade_info"
|
||||
# In case we're running as root, make sure files are owned properly
|
||||
chown -R "$myuser:$mygroup" "$datadir"
|
||||
else
|
||||
if [ -d "$datadir/mysql/" ] ; then
|
||||
# mysql dir exists, it seems data are initialized properly
|
||||
@ -123,8 +123,8 @@ else
|
||||
else
|
||||
# if the directory is not empty but mysql/ directory is missing, then
|
||||
# print error and let user to initialize manually or empty the directory
|
||||
echo "Database @NICE_PROJECT_NAME@ is not initialized, but the directory $datadir is not empty, so initialization cannot be done."
|
||||
echo "Make sure the $datadir is empty before running `basename $0`."
|
||||
echo "Database @NICE_PROJECT_NAME@ is not initialized, but the directory $datadir is not empty, so initialization cannot be done." >&2
|
||||
echo "Make sure the $datadir is empty before running `basename $0`." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
@ -18,13 +18,23 @@ get_mysql_option(){
|
||||
sections="$1"
|
||||
option_name="$2"
|
||||
default_value="$3"
|
||||
result=`@bindir@/my_print_defaults $sections | sed -n "s/^--${option_name}=//p" | tail -n 1`
|
||||
result=`@bindir@/my_print_defaults $my_print_defaults_extra_args $sections | sed -n "s/^--${option_name}=//p" | tail -n 1`
|
||||
if [ -z "$result" ]; then
|
||||
# not found, use default
|
||||
result="${default_value}"
|
||||
fi
|
||||
}
|
||||
|
||||
# For the case of running more instances via systemd, scrits that source
|
||||
# this file can get --default-group-suffix or similar option as the first
|
||||
# argument. The utility my_print_defaults needs to use it as well, so the
|
||||
# scripts sourcing this file work with the same options as the daemon.
|
||||
my_print_defaults_extra_args=''
|
||||
while echo "$1" | grep -q '^--defaults' ; do
|
||||
my_print_defaults_extra_args="${my_print_defaults_extra_args} $1"
|
||||
shift
|
||||
done
|
||||
|
||||
# Defaults here had better match what mysqld_safe will default to
|
||||
# The option values are generally defined on three important places
|
||||
# on the default installation:
|
||||
|
@ -1,45 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
|
||||
|
||||
# This script waits for mysqld to be ready to accept connections
|
||||
# (which can be many seconds or even minutes after launch, if there's
|
||||
# a lot of crash-recovery work to do).
|
||||
# Running this as ExecStartPost is useful so that services declared as
|
||||
# "After mysqld" won't be started until the database is really ready.
|
||||
|
||||
if [ $# -ne 1 ] ; then
|
||||
echo "You need to pass daemon pid as an argument for this script."
|
||||
exit 20
|
||||
fi
|
||||
|
||||
# Service file passes us the daemon's PID (actually, mysqld_safe's PID)
|
||||
daemon_pid="$1"
|
||||
|
||||
# Wait for the server to come up or for the mysqld process to disappear
|
||||
ret=0
|
||||
while /bin/true; do
|
||||
# Check process still exists
|
||||
if ! [ -d "/proc/${daemon_pid}" ] ; then
|
||||
ret=1
|
||||
break
|
||||
fi
|
||||
RESPONSE=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||||
mret=$?
|
||||
if [ $mret -eq 0 ] ; then
|
||||
break
|
||||
fi
|
||||
# exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
|
||||
# anything else suggests a configuration error
|
||||
if [ $mret -ne 1 -a $mret -ne 11 ]; then
|
||||
echo "Cannot check for @NICE_PROJECT_NAME@ Daemon startup because of mysqladmin failure." >&2
|
||||
ret=$mret
|
||||
break
|
||||
fi
|
||||
# "Access denied" also means the server is alive
|
||||
echo "$RESPONSE" | grep -q "Access denied for user" && break
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
||||
exit $ret
|
@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
|
||||
|
||||
# This script waits for mysqld to be properly stopped
|
||||
# (which can be many seconds in some large load).
|
||||
# Running this as ExecStopPost is useful so that starting which is done
|
||||
# as part of restart doesn't see the former process still running.
|
||||
|
||||
# Wait for the server to properly end the main server
|
||||
ret=0
|
||||
TIMEOUT=60
|
||||
SECONDS=0
|
||||
|
||||
if ! [ -f "$pidfile" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
MYSQLPID=`cat "$pidfile" 2>/dev/null`
|
||||
if [ -z "$MYSQLPID" ] ; then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
while /bin/true; do
|
||||
# Check process still exists
|
||||
if ! [ -d "/proc/${MYSQLPID}" ] ; then
|
||||
break
|
||||
fi
|
||||
if [ $SECONDS -gt $TIMEOUT ] ; then
|
||||
ret=3
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
exit $ret
|
@ -1,186 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @DAEMON_NAME@ This shell script takes care of starting and stopping
|
||||
# the MySQL subsystem (mysqld).
|
||||
#
|
||||
# chkconfig: - 64 36
|
||||
# description: MySQL database server.
|
||||
# processname: mysqld
|
||||
# config: @sysconfdir@/my.cnf
|
||||
# pidfile: /var/run/@DAEMON_NAME@/@DAEMON_NAME@.pid
|
||||
### BEGIN INIT INFO
|
||||
# Provides: mysqld
|
||||
# Required-Start: $local_fs $remote_fs $network $named $syslog $time
|
||||
# Required-Stop: $local_fs $remote_fs $network $named $syslog $time
|
||||
# Short-Description: start and stop MySQL server
|
||||
# Description: MySQL database server
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
# Source networking configuration.
|
||||
. /etc/sysconfig/network
|
||||
|
||||
|
||||
exec="@bindir@/mysqld_safe"
|
||||
prog="@DAEMON_NAME@"
|
||||
|
||||
# Set timeouts here so they can be overridden from @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@
|
||||
STARTTIMEOUT=300
|
||||
STOPTIMEOUT=60
|
||||
|
||||
# User and group the daemon will run under
|
||||
MYUSER=mysql
|
||||
MYGROUP=mysql
|
||||
|
||||
# Edit the following file in order to re-write some of the environment
|
||||
# variables defined above, like $STARTTIMEOUT, $STOPTIMEOUT, $exec
|
||||
[ -e @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@ ] && . @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@
|
||||
|
||||
lockfile=/var/lock/subsys/$prog
|
||||
|
||||
# get options from my.cnf
|
||||
source "@libexecdir@/mysql-scripts-common"
|
||||
|
||||
start(){
|
||||
[ -x $exec ] || exit 5
|
||||
|
||||
# check permissions
|
||||
if ! touch $(dirname $socketfile) &>/dev/null ; then
|
||||
action $"Starting $prog: " /bin/false
|
||||
return 4
|
||||
fi
|
||||
|
||||
# check to see if it's already running
|
||||
MYSQLDRUNNING=0
|
||||
if [ -f "$pidfile" ]; then
|
||||
MYSQLPID=`cat "$pidfile" 2>/dev/null`
|
||||
if [ -n "$MYSQLPID" ] && [ -d "/proc/$MYSQLPID" ] ; then
|
||||
MYSQLDRUNNING=1
|
||||
fi
|
||||
fi
|
||||
RESPONSE=`@bindir@/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||||
if [ $MYSQLDRUNNING = 1 ] && [ $? = 0 ]; then
|
||||
# already running, do nothing
|
||||
action $"Starting $prog: " /bin/true
|
||||
ret=0
|
||||
elif [ $MYSQLDRUNNING = 1 ] && echo "$RESPONSE" | grep -q "Access denied for user"
|
||||
then
|
||||
# already running, do nothing
|
||||
action $"Starting $prog: " /bin/true
|
||||
ret=0
|
||||
else
|
||||
@libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP || return 4
|
||||
@libexecdir@/mysql-check-socket || return 1
|
||||
|
||||
# Pass all the options determined above, to ensure consistent behavior.
|
||||
# In many cases mysqld_safe would arrive at the same conclusions anyway
|
||||
# but we need to be sure. (An exception is that we don't force the
|
||||
# log-error setting, since this script doesn't really depend on that,
|
||||
# and some users might prefer to configure logging to syslog.)
|
||||
# Note: set --basedir to prevent probes that might trigger SELinux
|
||||
# alarms, per bug #547485
|
||||
$exec --datadir="$datadir" --socket="$socketfile" \
|
||||
--pid-file="$pidfile" \
|
||||
--basedir=@prefix@ --user=$MYUSER >/dev/null 2>&1 &
|
||||
safe_pid=$!
|
||||
|
||||
# Wait until the daemon is up
|
||||
@libexecdir@/mysql-wait-ready "$safe_pid"
|
||||
ret=$?
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
action $"Starting $prog: " /bin/true
|
||||
chmod o+r $pidfile >/dev/null 2>&1
|
||||
touch $lockfile
|
||||
else
|
||||
action $"Starting $prog: " /bin/false
|
||||
fi
|
||||
fi
|
||||
return $ret
|
||||
}
|
||||
|
||||
stop(){
|
||||
if [ ! -f "$pidfile" ]; then
|
||||
# not running; per LSB standards this is "ok"
|
||||
action $"Stopping $prog: " /bin/true
|
||||
return 0
|
||||
fi
|
||||
MYSQLPID=`cat "$pidfile" 2>/dev/null`
|
||||
if [ -n "$MYSQLPID" ]; then
|
||||
if ! [ -d "/proc/$MYSQLPID" ] ; then
|
||||
# process doesn't run anymore
|
||||
action $"Stopping $prog: " /bin/true
|
||||
return 0
|
||||
fi
|
||||
/bin/kill "$MYSQLPID" >/dev/null 2>&1
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
TIMEOUT="$STOPTIMEOUT"
|
||||
while [ $TIMEOUT -gt 0 ]; do
|
||||
/bin/kill -0 "$MYSQLPID" >/dev/null 2>&1 || break
|
||||
sleep 1
|
||||
let TIMEOUT=${TIMEOUT}-1
|
||||
done
|
||||
if [ $TIMEOUT -eq 0 ]; then
|
||||
echo "Timeout error occurred trying to stop MySQL Daemon."
|
||||
ret=1
|
||||
action $"Stopping $prog: " /bin/false
|
||||
else
|
||||
rm -f $lockfile
|
||||
rm -f "$socketfile"
|
||||
action $"Stopping $prog: " /bin/true
|
||||
fi
|
||||
else
|
||||
# kill command failed, probably insufficient permissions
|
||||
action $"Stopping $prog: " /bin/false
|
||||
ret=4
|
||||
fi
|
||||
else
|
||||
# failed to read pidfile, probably insufficient permissions
|
||||
action $"Stopping $prog: " /bin/false
|
||||
ret=4
|
||||
fi
|
||||
return $ret
|
||||
}
|
||||
|
||||
restart(){
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
condrestart(){
|
||||
[ -e $lockfile ] && restart || :
|
||||
}
|
||||
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
status -p "$pidfile" $prog
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
condrestart|try-restart)
|
||||
condrestart
|
||||
;;
|
||||
reload)
|
||||
exit 3
|
||||
;;
|
||||
force-reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
@ -26,22 +26,28 @@
|
||||
|
||||
[Unit]
|
||||
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
|
||||
After=syslog.target
|
||||
Documentation=man:mysqld(8)
|
||||
Documentation=https://mariadb.com/kb/en/library/systemd/
|
||||
After=network.target
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Alias=mysql.service
|
||||
Alias=mysqld.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=mysql
|
||||
Group=mysql
|
||||
|
||||
ExecStartPre=@libexecdir@/mysql-check-socket
|
||||
# '%n' expands to 'Full unit name'; man systemd.unit
|
||||
ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
|
||||
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf
|
||||
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
|
||||
# per bug #547485
|
||||
ExecStart=@libexecdir@/mysqld --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
|
||||
ExecStartPost=@libexecdir@/mysql-check-upgrade
|
||||
ExecStopPost=@libexecdir@/mysql-wait-stop
|
||||
|
||||
# Setting this to true can break replication and the Type=notify settings
|
||||
# See also bind-address mysqld option.
|
||||
@ -65,6 +71,3 @@ TimeoutSec=300
|
||||
|
||||
# Place temp files in a secure directory, not /tmp
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -33,22 +33,27 @@
|
||||
|
||||
[Unit]
|
||||
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
|
||||
After=syslog.target
|
||||
Documentation=man:mysqld(8)
|
||||
Documentation=https://mariadb.com/kb/en/library/systemd/
|
||||
After=network.target
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Alias=mysql.service
|
||||
Alias=mysqld.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=mysql
|
||||
Group=mysql
|
||||
|
||||
ExecStartPre=@libexecdir@/mysql-check-socket
|
||||
ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
|
||||
ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I
|
||||
ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n
|
||||
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf
|
||||
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
|
||||
# per bug #547485
|
||||
ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
|
||||
ExecStartPost=@libexecdir@/mysql-check-upgrade
|
||||
ExecStopPost=@libexecdir@/mysql-wait-stop
|
||||
ExecStartPost=@libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I
|
||||
|
||||
# Setting this to true can break replication and the Type=notify settings
|
||||
# See also bind-address mysqld option.
|
||||
@ -72,6 +77,3 @@ TimeoutSec=300
|
||||
|
||||
# Place temp files in a secure directory, not /tmp
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -1,8 +1,21 @@
|
||||
main.partition_exchange : #1399847
|
||||
main.analyze_stmt_orderby : #1399847
|
||||
main.explain_json_innodb : #1399847
|
||||
main.explain_json_format_partitions : #1399847
|
||||
main.analyze_format_json : #1399847
|
||||
main.explain_json : #1399847
|
||||
main.subselect_cache : #1399847
|
||||
main.type_year : #1399847
|
||||
# Fails on aarch64
|
||||
encryption.create_or_replace :
|
||||
innodb_gis.rtree_compress2 :
|
||||
innodb.innodb_buffer_pool_resize :
|
||||
innodb.innodb_defrag_concurrent :
|
||||
|
||||
parts.partition_alter1_1_innodb :
|
||||
parts.partition_alter1_2_innodb :
|
||||
parts.partition_alter1_1_2_innodb :
|
||||
parts.partition_alter1_2_1_innodb :
|
||||
parts.partition_alter2_1_1_innodb :
|
||||
parts.partition_alter1_2_2_innodb :
|
||||
parts.partition_alter2_1_2_innodb :
|
||||
parts.partition_alter2_2_1_innodb :
|
||||
parts.partition_alter2_2_2_innodb :
|
||||
parts.partition_alter4_innodb :
|
||||
parts.partition_basic_innodb :
|
||||
parts.part_supported_sql_func_innodb :
|
||||
|
||||
# Check of testcase failed:
|
||||
sys_vars.innodb_buffer_pool_size_basic :
|
41
database/mariadb/centos/files/rh-skipped-tests-arm32.list
Normal file
41
database/mariadb/centos/files/rh-skipped-tests-arm32.list
Normal file
@ -0,0 +1,41 @@
|
||||
# Fails since 10.3.8, only on armv7hl
|
||||
versioning.auto_increment :
|
||||
versioning.commit_id :
|
||||
versioning.delete :
|
||||
versioning.foreign :
|
||||
versioning.insert :
|
||||
versioning.insert2 :
|
||||
versioning.select2 :
|
||||
versioning.update :
|
||||
|
||||
# Fails since 10.3.8, on both armv7hl and aarch64
|
||||
mariabackup.system_versioning :
|
||||
|
||||
# Fails since 10.3.9, on both armv7hl and aarch64
|
||||
disks.disks :
|
||||
encryption.create_or_replace :
|
||||
federated.federatedx_versioning :
|
||||
|
||||
# Fails since 10.3.9, only on armv7hl
|
||||
versioning.alter :
|
||||
versioning.replace :
|
||||
versioning.select :
|
||||
versioning.truncate :
|
||||
versioning.trx_id :
|
||||
# Fails since 10.3.17, only on armv7hl
|
||||
versioning.online :
|
||||
versioning.partition :
|
||||
versioning.replace :
|
||||
|
||||
# Fails since 10.3.9, only on aarch64
|
||||
innodb_gis.kill_server :
|
||||
innodb_gis.rtree_search :
|
||||
innodb.innodb_defrag_concurrent :
|
||||
parts.partition_alter1_1_2_innodb :
|
||||
parts.partition_alter1_2_innodb :
|
||||
parts.partition_alter2_1_1_innodb :
|
||||
parts.partition_alter2_1_2_innodb :
|
||||
parts.partition_alter2_2_1_innodb :
|
||||
parts.partition_alter2_2_2_innodb :
|
||||
parts.partition_basic_innodb :
|
||||
parts.part_supported_sql_func_innodb :
|
@ -1,9 +1,27 @@
|
||||
main.userstat : #1399847
|
||||
main.multi_update : #1399847
|
||||
main.set_statement_notembedded_binlog : #1399847
|
||||
main.ssl_7937 : #1399847
|
||||
main.ssl_crl_clients : #1399847
|
||||
main.ssl_cert_verify : #1399847
|
||||
perfschema.nesting : #1399847
|
||||
perfschema.socket_summary_by_event_name_func : #1399847
|
||||
perfschema.socket_summary_by_instance_func : #1399847
|
||||
# Fails everywhere
|
||||
innodb.innodb_defrag_binlog :
|
||||
main.mysql :
|
||||
main.ssl_7937 :
|
||||
main.ssl_8k_key :
|
||||
main.ssl_crl :
|
||||
main.userstat :
|
||||
perfschema.cnf_option :
|
||||
perfschema.nesting :
|
||||
perfschema.socket_summary_by_event_name_func :
|
||||
perfschema.socket_summary_by_instance_func :
|
||||
rpl.rpl_row_img_blobs :
|
||||
rpl.rpl_row_img_eng_min :
|
||||
rpl.rpl_row_img_eng_noblob :
|
||||
sys_vars.slave_parallel_threads_basic :
|
||||
unit.conc_ps_bugs :
|
||||
versioning.update-big :
|
||||
# Fails only on i686
|
||||
main.myisampack :
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
21
database/mariadb/centos/files/rh-skipped-tests-ppc.list
Normal file
21
database/mariadb/centos/files/rh-skipped-tests-ppc.list
Normal file
@ -0,0 +1,21 @@
|
||||
# Fails on ppc64le
|
||||
encryption.create_or_replace :
|
||||
innodb_gis.rtree_compress2 :
|
||||
innodb.innodb_buffer_pool_resize :
|
||||
innodb.innodb_defrag_concurrent :
|
||||
|
||||
parts.partition_alter1_1_innodb :
|
||||
parts.partition_alter1_2_innodb :
|
||||
parts.partition_alter1_1_2_innodb :
|
||||
parts.partition_alter1_2_1_innodb :
|
||||
parts.partition_alter2_1_1_innodb :
|
||||
parts.partition_alter1_2_2_innodb :
|
||||
parts.partition_alter2_1_2_innodb :
|
||||
parts.partition_alter2_2_1_innodb :
|
||||
parts.partition_alter2_2_2_innodb :
|
||||
parts.partition_alter4_innodb :
|
||||
parts.partition_basic_innodb :
|
||||
parts.part_supported_sql_func_innodb :
|
||||
|
||||
# Check of testcase failed:
|
||||
sys_vars.innodb_buffer_pool_size_basic :
|
2
database/mariadb/centos/files/rh-skipped-tests-s390.list
Normal file
2
database/mariadb/centos/files/rh-skipped-tests-s390.list
Normal file
@ -0,0 +1,2 @@
|
||||
# Fails on s390x
|
||||
handler.heap :
|
482
database/mariadb/centos/files/wsrep_sst_rsync_tunnel
Normal file
482
database/mariadb/centos/files/wsrep_sst_rsync_tunnel
Normal file
@ -0,0 +1,482 @@
|
||||
#!/bin/bash -ue
|
||||
|
||||
# Copyright (C) 2010-2014 Codership Oy
|
||||
# Copyright (C) 2017 Damien Ciabrini <damien.ciabrini@gmail.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING. If not, write to the
|
||||
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
|
||||
# MA 02110-1301 USA.
|
||||
|
||||
# This is a reference script for rsync-based state snapshot tansfer
|
||||
# over an encrypted communication channel, managed by socat
|
||||
|
||||
RSYNC_PID= # rsync pid file
|
||||
RSYNC_CONF= # rsync configuration file
|
||||
RSYNC_REAL_PID= # rsync process id
|
||||
|
||||
SOCAT_PID= # socat pid file
|
||||
SOCAT_REAL_PID= # socat process id
|
||||
|
||||
SOCAT_OPTS= # openssl connection args
|
||||
|
||||
MODULE="rsync_tunnel_sst"
|
||||
|
||||
OS=$(uname)
|
||||
[ "$OS" == "Darwin" ] && export -n LD_LIBRARY_PATH
|
||||
|
||||
# Setting the path for lsof on CentOS
|
||||
export PATH="/usr/sbin:/sbin:$PATH"
|
||||
|
||||
. $(dirname $0)/wsrep_sst_common
|
||||
|
||||
wsrep_check_programs rsync socat
|
||||
|
||||
cleanup_pid()
|
||||
{
|
||||
local real_pid=$1
|
||||
[ "0" != "$real_pid" ] && \
|
||||
kill $real_pid && \
|
||||
sleep 0.5 && \
|
||||
kill -9 $real_pid >/dev/null 2>&1 || \
|
||||
:
|
||||
}
|
||||
|
||||
cleanup_tunnel()
|
||||
{
|
||||
wsrep_log_info "cleanup socat PID: $SOCAT_REAL_PID"
|
||||
[ -n "$SOCAT_REAL_PID" ] && cleanup_pid $SOCAT_REAL_PID
|
||||
rm -rf "$SOCAT_PID"
|
||||
}
|
||||
|
||||
cleanup_joiner()
|
||||
{
|
||||
wsrep_log_info "Joiner cleanup. rsync PID: $RSYNC_REAL_PID"
|
||||
[ -n "$RSYNC_REAL_PID" ] && cleanup_pid $RSYNC_REAL_PID
|
||||
rm -rf "$RSYNC_CONF"
|
||||
rm -rf "$MAGIC_FILE"
|
||||
rm -rf "$RSYNC_PID"
|
||||
|
||||
cleanup_tunnel
|
||||
|
||||
wsrep_log_info "Joiner cleanup done."
|
||||
if [ "${WSREP_SST_OPT_ROLE}" = "joiner" ];then
|
||||
wsrep_cleanup_progress_file
|
||||
fi
|
||||
}
|
||||
|
||||
# Check whether process is still running.
|
||||
check_pid()
|
||||
{
|
||||
local pid_file=$1
|
||||
[ -r "$pid_file" ] && ps -p $(cat $pid_file) >/dev/null 2>&1
|
||||
}
|
||||
|
||||
check_pid_and_port()
|
||||
{
|
||||
local pid_file=$1
|
||||
local service_pid=$2
|
||||
local service_port=$3
|
||||
local service_host=$4
|
||||
local service_name=$5
|
||||
|
||||
if ! which lsof > /dev/null; then
|
||||
wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed."
|
||||
exit 2 # ENOENT
|
||||
fi
|
||||
|
||||
local port_info=$(lsof -i "@"$service_host:$service_port -Pn 2>/dev/null | \
|
||||
grep "(LISTEN)")
|
||||
local is_service=$(echo $port_info | \
|
||||
grep -w '^'"$service_name"'[[:space:]]\+'"$service_pid" 2>/dev/null)
|
||||
|
||||
if [ -n "$port_info" -a -z "$is_service" ]; then
|
||||
wsrep_log_error "$service_name daemon port '$service_port' has been taken"
|
||||
exit 16 # EBUSY
|
||||
fi
|
||||
|
||||
if ! check_pid $pid_file; then
|
||||
wsrep_log_error "$service_name process terminated unexpectedly"
|
||||
exit 10 # ECHILD
|
||||
fi
|
||||
|
||||
[ -n "$port_info" ] && [ -n "$is_service" ] && \
|
||||
[ $(cat $pid_file) -eq $service_pid ]
|
||||
}
|
||||
|
||||
config_from_cnf()
|
||||
{
|
||||
local group=$1
|
||||
local key=$2
|
||||
echo $($MY_PRINT_DEFAULTS $group | grep -- "--$key=" | cut -d= -f2- | tail -1)
|
||||
}
|
||||
|
||||
setup_tunnel_args()
|
||||
{
|
||||
tca=$(config_from_cnf sst tca)
|
||||
tkey=$(config_from_cnf sst tkey)
|
||||
tcert=$(config_from_cnf sst tcert)
|
||||
sockopt=$(config_from_cnf sst sockopt)
|
||||
|
||||
if [ -z "$tcert" ]; then
|
||||
wsrep_log_error "Encryption certificate not found in my.cnf"
|
||||
exit 3
|
||||
else
|
||||
SOCAT_OPTS="cert=$tcert"
|
||||
fi
|
||||
[ -n "$tkey" ] && SOCAT_OPTS="$SOCAT_OPTS,key=$tkey"
|
||||
[ -n "$tca" ] && SOCAT_OPTS="$SOCAT_OPTS,cafile=$tca"
|
||||
wsrep_log_info "Encryption setting to be used for socat tunnel: $SOCAT_OPTS"
|
||||
|
||||
[ -n "$sockopt" ] && SOCAT_OPTS="$SOCAT_OPTS,$sockopt"
|
||||
}
|
||||
|
||||
MAGIC_FILE="$WSREP_SST_OPT_DATA/rsync_tunnel_sst_complete"
|
||||
rm -rf "$MAGIC_FILE"
|
||||
|
||||
BINLOG_TAR_FILE="$WSREP_SST_OPT_DATA/wsrep_sst_binlog.tar"
|
||||
BINLOG_N_FILES=1
|
||||
rm -f "$BINLOG_TAR_FILE" || :
|
||||
|
||||
if ! [ -z $WSREP_SST_OPT_BINLOG ]
|
||||
then
|
||||
BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
|
||||
BINLOG_FILENAME=$(basename $WSREP_SST_OPT_BINLOG)
|
||||
fi
|
||||
|
||||
WSREP_LOG_DIR=${WSREP_LOG_DIR:-""}
|
||||
# if WSREP_LOG_DIR env. variable is not set, try to get it from my.cnf
|
||||
if [ -z "$WSREP_LOG_DIR" ]; then
|
||||
WSREP_LOG_DIR=$($MY_PRINT_DEFAULTS --mysqld \
|
||||
| grep -- '--innodb[-_]log[-_]group[-_]home[-_]dir=' \
|
||||
| cut -b 29- )
|
||||
fi
|
||||
|
||||
if [ -n "$WSREP_LOG_DIR" ]; then
|
||||
# handle both relative and absolute paths
|
||||
WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; mkdir -p "$WSREP_LOG_DIR"; cd $WSREP_LOG_DIR; pwd -P)
|
||||
else
|
||||
# default to datadir
|
||||
WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P)
|
||||
fi
|
||||
|
||||
# Old filter - include everything except selected
|
||||
# FILTER=(--exclude '*.err' --exclude '*.pid' --exclude '*.sock' \
|
||||
# --exclude '*.conf' --exclude core --exclude 'galera.*' \
|
||||
# --exclude grastate.txt --exclude '*.pem' \
|
||||
# --exclude '*.[0-9][0-9][0-9][0-9][0-9][0-9]' --exclude '*.index')
|
||||
|
||||
# New filter - exclude everything except dirs (schemas) and innodb files
|
||||
FILTER=(-f '- /lost+found' -f '- /.fseventsd' -f '- /.Trashes'
|
||||
-f '+ /wsrep_sst_binlog.tar' -f '+ /ib_lru_dump' -f '+ /ibdata*' -f '+ /*/' -f '- /*')
|
||||
|
||||
SOCAT_PID="$WSREP_SST_OPT_DATA/$MODULE-socat.pid"
|
||||
|
||||
if check_pid $SOCAT_PID
|
||||
then
|
||||
wsrep_log_error "socat tunnel already running."
|
||||
exit 114 # EALREADY
|
||||
fi
|
||||
rm -rf "$SOCAT_PID"
|
||||
|
||||
setup_tunnel_args
|
||||
|
||||
if [ "$WSREP_SST_OPT_ROLE" = "donor" ]
|
||||
then
|
||||
|
||||
SOCAT_JOINER_ADDR=$(echo $WSREP_SST_OPT_ADDR | awk -F'/' '{print $1}')
|
||||
# map to name in case we received an IP
|
||||
SOCAT_JOINER_HOST=$(getent hosts $SOCAT_JOINER_ADDR | awk '{ print $2 }')
|
||||
if [ -z "$SOCAT_JOINER_HOST" ]; then
|
||||
SOCAT_JOINER_HOST=$SOCAT_JOINER_ADDR
|
||||
fi
|
||||
SOCAT_PORT=$(echo $SOCAT_JOINER_ADDR | awk -F ':' '{ print $2 }')
|
||||
if [ -z "$SOCAT_PORT" ]
|
||||
then
|
||||
SOCAT_PORT=4444
|
||||
fi
|
||||
TARGET_ADDR=localhost:$SOCAT_PORT/$MODULE
|
||||
|
||||
trap cleanup_tunnel EXIT
|
||||
|
||||
# Socat forwards rsync connections to the joiner
|
||||
SOCAT_SRC=tcp-listen:$SOCAT_PORT,bind=localhost,reuseaddr,fork
|
||||
SOCAT_DST=openssl:$SOCAT_JOINER_HOST,$SOCAT_OPTS
|
||||
wsrep_log_info "Setting up tunnel for donor: socat $SOCAT_SRC $SOCAT_DST"
|
||||
socat $SOCAT_SRC $SOCAT_DST &
|
||||
SOCAT_REAL_PID=$!
|
||||
# This is ok because a local galera node doesn't run SST concurrently
|
||||
echo $SOCAT_REAL_PID >"$SOCAT_PID"
|
||||
until check_pid_and_port $SOCAT_PID $SOCAT_REAL_PID $SOCAT_PORT localhost "socat"
|
||||
do
|
||||
sleep 0.2
|
||||
done
|
||||
|
||||
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]
|
||||
then
|
||||
|
||||
FLUSHED="$WSREP_SST_OPT_DATA/tables_flushed"
|
||||
ERROR="$WSREP_SST_OPT_DATA/sst_error"
|
||||
|
||||
rm -rf "$FLUSHED"
|
||||
rm -rf "$ERROR"
|
||||
|
||||
# Use deltaxfer only for WAN
|
||||
inv=$(basename $0)
|
||||
[ "$inv" = "wsrep_sst_rsync_wan" ] && WHOLE_FILE_OPT="" \
|
||||
|| WHOLE_FILE_OPT="--whole-file"
|
||||
|
||||
echo "flush tables"
|
||||
|
||||
# Wait for :
|
||||
# (a) Tables to be flushed, AND
|
||||
# (b) Cluster state ID & wsrep_gtid_domain_id to be written to the file, OR
|
||||
# (c) ERROR file, in case flush tables operation failed.
|
||||
|
||||
while [ ! -r "$FLUSHED" ] && ! grep -q ':' "$FLUSHED" >/dev/null 2>&1
|
||||
do
|
||||
# Check whether ERROR file exists.
|
||||
if [ -f "$ERROR" ]
|
||||
then
|
||||
# Flush tables operation failed.
|
||||
rm -rf "$ERROR"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
sleep 0.2
|
||||
done
|
||||
|
||||
STATE="$(cat $FLUSHED)"
|
||||
rm -rf "$FLUSHED"
|
||||
|
||||
sync
|
||||
|
||||
if ! [ -z $WSREP_SST_OPT_BINLOG ]
|
||||
then
|
||||
# Prepare binlog files
|
||||
pushd $BINLOG_DIRNAME &> /dev/null
|
||||
binlog_files_full=$(tail -n $BINLOG_N_FILES ${BINLOG_FILENAME}.index)
|
||||
binlog_files=""
|
||||
for ii in $binlog_files_full
|
||||
do
|
||||
binlog_files="$binlog_files $(basename $ii)"
|
||||
done
|
||||
if ! [ -z "$binlog_files" ]
|
||||
then
|
||||
wsrep_log_info "Preparing binlog files for transfer:"
|
||||
tar -cvf $BINLOG_TAR_FILE $binlog_files >&2
|
||||
fi
|
||||
popd &> /dev/null
|
||||
fi
|
||||
|
||||
# first, the normal directories, so that we can detect incompatible protocol
|
||||
RC=0
|
||||
rsync --owner --group --perms --links --specials \
|
||||
--ignore-times --inplace --dirs --delete --quiet \
|
||||
$WHOLE_FILE_OPT "${FILTER[@]}" "$WSREP_SST_OPT_DATA/" \
|
||||
rsync://$TARGET_ADDR >&2 || RC=$?
|
||||
|
||||
if [ "$RC" -ne 0 ]; then
|
||||
wsrep_log_error "rsync returned code $RC:"
|
||||
|
||||
case $RC in
|
||||
12) RC=71 # EPROTO
|
||||
wsrep_log_error \
|
||||
"rsync server on the other end has incompatible protocol. " \
|
||||
"Make sure you have the same version of rsync on all nodes."
|
||||
;;
|
||||
22) RC=12 # ENOMEM
|
||||
;;
|
||||
*) RC=255 # unknown error
|
||||
;;
|
||||
esac
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
# second, we transfer InnoDB log files
|
||||
rsync --owner --group --perms --links --specials \
|
||||
--ignore-times --inplace --dirs --delete --quiet \
|
||||
$WHOLE_FILE_OPT -f '+ /ib_logfile[0-9]*' -f '- **' "$WSREP_LOG_DIR/" \
|
||||
rsync://$TARGET_ADDR-log_dir >&2 || RC=$?
|
||||
|
||||
if [ $RC -ne 0 ]; then
|
||||
wsrep_log_error "rsync innodb_log_group_home_dir returned code $RC:"
|
||||
exit 255 # unknown error
|
||||
fi
|
||||
|
||||
# then, we parallelize the transfer of database directories, use . so that pathconcatenation works
|
||||
pushd "$WSREP_SST_OPT_DATA" >/dev/null
|
||||
|
||||
count=1
|
||||
[ "$OS" == "Linux" ] && count=$(grep -c processor /proc/cpuinfo)
|
||||
[ "$OS" == "Darwin" -o "$OS" == "FreeBSD" ] && count=$(sysctl -n hw.ncpu)
|
||||
|
||||
find . -maxdepth 1 -mindepth 1 -type d -not -name "lost+found" -print0 | \
|
||||
xargs -I{} -0 -P $count \
|
||||
rsync --owner --group --perms --links --specials \
|
||||
--ignore-times --inplace --recursive --delete --quiet \
|
||||
$WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \
|
||||
rsync://$TARGET_ADDR/{} >&2 || RC=$?
|
||||
|
||||
popd >/dev/null
|
||||
|
||||
if [ $RC -ne 0 ]; then
|
||||
wsrep_log_error "find/rsync returned code $RC:"
|
||||
exit 255 # unknown error
|
||||
fi
|
||||
|
||||
else # BYPASS
|
||||
wsrep_log_info "Bypassing state dump."
|
||||
|
||||
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
|
||||
# (separated by a space).
|
||||
STATE="$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID"
|
||||
fi
|
||||
|
||||
echo "continue" # now server can resume updating data
|
||||
|
||||
echo "$STATE" > "$MAGIC_FILE"
|
||||
rsync --archive --quiet --checksum "$MAGIC_FILE" rsync://$TARGET_ADDR
|
||||
|
||||
echo "done $STATE"
|
||||
|
||||
elif [ "$WSREP_SST_OPT_ROLE" = "joiner" ]
|
||||
then
|
||||
wsrep_check_programs lsof socat
|
||||
|
||||
touch $SST_PROGRESS_FILE
|
||||
MYSQLD_PID=$WSREP_SST_OPT_PARENT
|
||||
|
||||
RSYNC_PID="$WSREP_SST_OPT_DATA/$MODULE.pid"
|
||||
|
||||
if check_pid $RSYNC_PID
|
||||
then
|
||||
wsrep_log_error "rsync daemon already running."
|
||||
exit 114 # EALREADY
|
||||
fi
|
||||
rm -rf "$RSYNC_PID"
|
||||
|
||||
ADDR=$WSREP_SST_OPT_ADDR
|
||||
RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }')
|
||||
if [ -z "$RSYNC_PORT" ]
|
||||
then
|
||||
RSYNC_PORT=4444
|
||||
ADDR="$(echo $ADDR | awk -F ':' '{ print $1 }'):$RSYNC_PORT"
|
||||
fi
|
||||
|
||||
SOCAT_ADDR=$(echo $ADDR | awk -F ':' '{ print $1 }')
|
||||
# map to name in case we received an IP
|
||||
SOCAT_HOST=$(getent hosts $SOCAT_ADDR | awk '{ print $2 }')
|
||||
if [ -z "$SOCAT_HOST" ]; then
|
||||
SOCAT_HOST=$SOCAT_ADDR
|
||||
fi
|
||||
SOCAT_PORT=$RSYNC_PORT
|
||||
|
||||
trap "exit 32" HUP PIPE
|
||||
trap "exit 3" INT TERM ABRT
|
||||
trap cleanup_joiner EXIT
|
||||
|
||||
RSYNC_CONF="$WSREP_SST_OPT_DATA/$MODULE.conf"
|
||||
|
||||
if [ -n "${MYSQL_TMP_DIR:-}" ] ; then
|
||||
SILENT="log file = $MYSQL_TMP_DIR/rsynd.log"
|
||||
else
|
||||
SILENT=""
|
||||
fi
|
||||
|
||||
cat << EOF > "$RSYNC_CONF"
|
||||
pid file = $RSYNC_PID
|
||||
use chroot = no
|
||||
read only = no
|
||||
timeout = 300
|
||||
$SILENT
|
||||
[$MODULE]
|
||||
path = $WSREP_SST_OPT_DATA
|
||||
[$MODULE-log_dir]
|
||||
path = $WSREP_LOG_DIR
|
||||
EOF
|
||||
|
||||
# rm -rf "$DATA"/ib_logfile* # we don't want old logs around
|
||||
|
||||
# Socat receives rsync connections from the donor
|
||||
SOCAT_SRC=openssl-listen:$SOCAT_PORT,bind=$SOCAT_HOST,reuseaddr,fork,$SOCAT_OPTS
|
||||
SOCAT_DST=tcp:localhost:$RSYNC_PORT
|
||||
wsrep_log_info "Setting up tunnel for joiner: socat $SOCAT_SRC $SOCAT_DST"
|
||||
socat $SOCAT_SRC $SOCAT_DST &
|
||||
SOCAT_REAL_PID=$!
|
||||
# This is ok because a local galera node doesn't run SST concurrently
|
||||
echo $SOCAT_REAL_PID >"$SOCAT_PID"
|
||||
until check_pid_and_port $SOCAT_PID $SOCAT_REAL_PID $SOCAT_PORT $SOCAT_HOST "socat"
|
||||
do
|
||||
sleep 0.2
|
||||
done
|
||||
|
||||
wsrep_log_info "rsync --daemon --no-detach --address localhost --port $RSYNC_PORT --config \"$RSYNC_CONF\""
|
||||
rsync --daemon --no-detach --address localhost --port $RSYNC_PORT --config "$RSYNC_CONF" &
|
||||
RSYNC_REAL_PID=$!
|
||||
|
||||
until check_pid_and_port $RSYNC_PID $RSYNC_REAL_PID $RSYNC_PORT localhost "rsync"
|
||||
do
|
||||
sleep 0.2
|
||||
done
|
||||
|
||||
echo "ready $ADDR/$MODULE"
|
||||
|
||||
# wait for SST to complete by monitoring magic file
|
||||
while [ ! -r "$MAGIC_FILE" ] && check_pid "$RSYNC_PID" && \
|
||||
check_pid "$SOCAT_PID" && ps -p $MYSQLD_PID >/dev/null
|
||||
do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if ! ps -p $MYSQLD_PID >/dev/null
|
||||
then
|
||||
wsrep_log_error \
|
||||
"Parent mysqld process (PID:$MYSQLD_PID) terminated unexpectedly."
|
||||
exit 32
|
||||
fi
|
||||
|
||||
if ! [ -z $WSREP_SST_OPT_BINLOG ]
|
||||
then
|
||||
|
||||
pushd $BINLOG_DIRNAME &> /dev/null
|
||||
if [ -f $BINLOG_TAR_FILE ]
|
||||
then
|
||||
# Clean up old binlog files first
|
||||
rm -f ${BINLOG_FILENAME}.*
|
||||
wsrep_log_info "Extracting binlog files:"
|
||||
tar -xvf $BINLOG_TAR_FILE >&2
|
||||
for ii in $(ls -1 ${BINLOG_FILENAME}.*)
|
||||
do
|
||||
echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_FILENAME}.index
|
||||
done
|
||||
fi
|
||||
popd &> /dev/null
|
||||
fi
|
||||
if [ -r "$MAGIC_FILE" ]
|
||||
then
|
||||
# UUID:seqno & wsrep_gtid_domain_id is received here.
|
||||
cat "$MAGIC_FILE" # Output : UUID:seqno wsrep_gtid_domain_id
|
||||
else
|
||||
# this message should cause joiner to abort
|
||||
echo "rsync process ended without creating '$MAGIC_FILE'"
|
||||
fi
|
||||
wsrep_cleanup_progress_file
|
||||
# cleanup_joiner
|
||||
else
|
||||
wsrep_log_error "Unrecognized role: '$WSREP_SST_OPT_ROLE'"
|
||||
exit 22 # EINVAL
|
||||
fi
|
||||
|
||||
rm -f $BINLOG_TAR_FILE || :
|
||||
|
||||
exit 0
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user