Commit graph

49 commits

Author SHA1 Message Date
Sergei Golubchik
c383418cbf Merge branch 'github/10.0-galera' into 10.1 2018-02-03 08:09:06 +01:00
Daniel Black
be83785d73 MDEV-13789: FreeBSD wsrep_sst_xtrabackup-v2 - find compatibilty +lsof
Based off #451 by angeloudy <angeloudy@yahoo.com> and
Tao Zhou <taozhou@ip-179.ish.com.au>
2018-01-18 22:06:17 +11:00
Daniel Black
c4b7074e72 wsrep_sst_xtrabackup*: use mysqld defaults arguments
It was assumed in
https://bugs.launchpad.net/codership-mysql/+bug/1378355 that xtrabackup
didn't have the groups-defaults-suffix because it wasn't listed in the
help output.

Also --defaults-group was always just an additional group despite the
misleading description implying it was a replacement.

So actually we can use the default* mysqld arguements to xtrabackup as
the standard mysqld configuration parser was used.
2018-01-16 14:44:39 +11:00
Daniel Black
a2a038152e wsrep_sst_xtrabackup*: use wsrep_sst_common parsed vars 2018-01-14 23:31:14 +11:00
Daniel Black
722df90534 wsrep_sst_xtrabackup*: read all sections of config not nust mysqld
--mysqld parsed to parse_cnf aka my_print_defaults will parse all
sections which the server read and not just mysqld.
2018-01-14 23:31:13 +11:00
Daniel Black
cc8abb21e3 wsrep_sst_xtrabackup*: du -s removed lessens output
and only displays the summary. As this is the only bit
that is used there will be less du,kernel,awk CPU usage.
2018-01-14 23:31:13 +11:00
Sergei Golubchik
943c62a5d4 Backport 4bb49d84a9, correct handling on defaults[-extra]-file is SST scripts
(from 10.1 to 10.0-galera)

This conflicted signficantly with 7d550c76be
which added --defaults-group-suffix support.

Took the approach of 4bb49d84a9 and adapted the
--defaults-group-suffix handling to be consistent.

The following changes as follows:

SST scripts now use $MY_PRINT_DEFAULTS rather than the lowercase for
consistency and this include all required --default arguements.

Backport/merge by Daniel Black <daniel@linux.vnet.ibm.com>
2018-01-14 22:48:02 +11:00
Sachin Setiya
2a4faa8ab6 MDEV-13478 Full SST sync fails because of the error in the cleaning part
Problem:
 The command was:
    find $paths -mindepth 1 -regex $cpat -prune -o -exec rm -rf {} \+
 Which was supposed to work as
    * skipping $paths directories themselves (-mindepth 1)
    * see if the dir/file name matches $cpat (-regex)
    * if yes - don't dive into the directory, skip it (-prune)
    * otherwise (-o)
    * remove it and everything inside (-exec)
 Now -exec ... \+ works like this:
    every new found path is appended to the end of the command line.
    when accumulated command line length reaches `getconf ARG_MAX` (~2Gb)
    it's executed, and find continues, appending to a new command line.

 What happens here, find appends some directory to the command line,
 then dives into it, and starts appending files from that directory.
 At some point command line overflows, rm -rf gets executed and removes
 the whole directory. Now find tries to continue scanning the directory
 that was already removed.

Fix: don't dive into directories that will be recursively removed
anyway, use -prune for them. Basically, we should be pruning both paths
that have matched $cpat and paths that have not matched it. This is
achived by pruning unconditionally, before the regex is tested:
    find $paths -mindepth 1 -prune -regex $cpat -o -exec rm -rf {} \+

Patch Credit:- Serg
2017-12-20 18:51:30 +01:00
Martynas Bendorius
1c2f59f7fb MDEV-13969 sst mysqldump and xtrabackup-v2 handle WSREP_SST_OPT_CONF incorrectly
wrep_sst_common: Setting "-c ''" for my_print_defaults just takes no values from config at all. $MY_PRINT_DEFAULTS is already set at the top of the script to have --defaults-file and --defaults-extra-file. If WSREP_SST_OPT_CONF if set to "--defaults-file=/etc/my.cnf --defaults-extra-file=/etc/my.extra.cnf", then "my_print_defaults -c "" --defaults-file=/etc/my.cnf" succeeds, but if WSREP_SST_OPT_CONF is empty - no default values are taken at all.
wsrep_sst_xtrabackup-v2: innobackupex does not support --defaults-extra-file, so ${WSREP_SST_OPT_CONF} cannot be used as an argument, it has been changed to ${WSREP_SST_OPT_DEFAULT}. Removed --defaults-file= from INNOMOVE line, because WSREP_SST_OPT_CONF already includes it (INNOBACKUP was fine, INNOMOVE - not).
2017-12-18 16:41:40 +01:00
Andrii Nikitin
494d1bf885 MDEV-14010 merge issue in wsrep_sst_xtrabackup-v2 2017-10-09 10:22:47 +02:00
Jan Lindström
c23efc7d50 Merge remote-tracking branch 'origin/10.0-galera' into 10.1 2017-08-21 13:35:00 +03:00
Alexey Yurchenko
83664e21e4 MW-366 Improved support for IPv6 networks - made mysqld and SST scripts to recognize []-escaped IPv6 addresses - pulled in latest Percona and MariaDB updates to SST scripts - instruct netcat and socat in wsrep_sst_xtrabackup-v2 to listen on IPv6 socket via sockopt parameter in the [sst] section of my.cnf
In summary, wsrep_node_address and wsrep_sst_receive_address can now
be set to IPv6 addresses escaped by []. Rsync SST works out ouf the
box thanks to rsync daemon listening on both IPv4 and IPv6 sockets by
default. For xtrabackup SST onver IPv6 one needs to set sockopt in
the [sst] section of joiner's configuration file to ",pf=ip6" if
using socat as a streamer or to "-6" if using netcat.
2017-08-11 15:00:18 +03:00
Nirbhay Choubey
e1c6f28f0d Merge branch '10.0-galera' into 10.1 2016-09-28 13:20:02 -04:00
Hartmut Holzgraefe
c9ded859a6 MDEV-10853 netcat help output in error log when running xtrabackup SST 2016-09-28 12:53:43 -04:00
Nirbhay Choubey
90266e8a0e Merge branch '10.0-galera' into bb-10.1-serg 2016-08-25 15:39:39 -04:00
sjaakola
58386ca04d refs codership/mysql-wsrep#239
Synced xtrabackup SST scripts from PXC source tree as of PXC 5.6.27-25.13
- PXC#480: xtrabackup-v2 SST fails with multiple log_bin directives in my.cn
- PXC#460: wsrep_sst_auth don't work in Percona-XtraDB-Cluster-56-5.6.25-25.
- PXC-416: Fix SST related issues.
- PXC-389: Merge remote-tracking branch 'wsrep/5.6' into 5.6-wsrep-pxc389
- Bug #1431101: SST does not clobber backup-my.cnf
2016-08-21 16:16:58 -04:00
Martin Stefany
64c115b835 Use hostname instead of IP in donor's socat
Using IP address in donor's socat with TLS/SSL and certificate
which doesn't contain IP address in CN or SubjectAltName causes
transfer to fail with message:

socat[5799] E certificate is valid but its commonName does not
match hostname.

This patch tries to reverse resolve IP address to hostname and
use it for transfer. If reverse resolution fails, IP address is
still used as fall-back, so proper A/AAAA and PTR records are
important, but not mandatory.

Certain certificates cannot contain IP addresses, e.g. FreeIPA's
Dogtag doesn't allow it, so in my case I would need to use self-
signed certificates instead, use verify=0 with socat or don't use
TLS/SSL at all. Issue is mentioned in MDEV-9403.
2016-06-27 21:50:34 -04:00
Nirbhay Choubey
0a1c2a2051 Merge branch '10.0-galera' into 10.1 2016-05-05 09:15:04 -04:00
Nirbhay Choubey
c0238be6cf Merge branch '5.5-galera' into 10.0-galera 2016-04-29 16:59:25 -04:00
Nirbhay Choubey
51a32ebeb3 MDEV-9884: Existing /var/lib/mysql/.sst directory (with contents) causes SST to fail with xtrabackup-v2
[Fix taken from https://github.com/percona/percona-xtradb-
cluster/commit/b3ee75949ed82b88f355ca2e26431350cc1c89ac]

During SST, the receiver node creates .sst directory under
datadir to process/prepare the received data and removes it
at the end of the process. In case of error, this directory,
however, was not removed, which later caused subsequent SSTs
to fail. Fixed by removing this directory at the beginning
of SST if it existed.
2016-04-27 12:29:25 -04:00
Nirbhay Choubey
cceec7858f Merge branch '10.0-galera' into bb-10.1-serg 2016-02-24 01:21:40 -05:00
Krunal Bauskar
f67d6fccac - PXC#480: xtrabackup-v2 SST fails with multiple log_bin directives in my.cnf
If any given variable the xtrabackup-v2 sst script looks for is specified
  multiple times in cnf file then it tend to pick both of them causing
  some of the follow-up command to fail.

  Avoid this programatic mistake by honoring only the last variable assigned
  setting as done by mysqld too.

  Check https://bugs.launchpad.net/percona-xtradb-cluster/+bug/1362830
2016-02-23 21:46:53 -05:00
Krunal Bauskar
0cf66e49db - PXC#460: wsrep_sst_auth don't work in Percona-XtraDB-Cluster-56-5.6.25-25.12.1.el7
Semantics:
---------

* Generally end-user will create a separate user with needed
privileges for
    performing DONOR action.
* This user credentials are specified using wsrep_sst_auth.

* Along with this user there could be other user(s) created on the
server
    that sysadmin may use for normal or other operations
* Credentials for these user(s) can be specified in same
cluster/server
    cnf file as part of [client] section

When cluster act as DONOR and if wsrep_sst_auth is provided then it
should
strictly use it for performing SST based action.

What if end-user has same credentials for performing both SST action
and
normal admin work ?
* Then end-user can simply specify these credentials as part of
[client]
    section in cnf file and skip providing wsrep_sst_auth.

Issue:
-----

MySQL client user/password parsing preference order is as follows:
* command line (through --user/--password)
* cnf file
* MYSQL_PWD enviornment variable.

Recent change tried passing sst user password through MYSQL_PWD
(and user though --user command line param as before).

On the system where-in admin had another user for performing non-SST
actions,
credentials for such user were present in cnf file under [client]
section.

Due to mysql client preference order, SST user name was used (as it
was
passed through command line) but password of other user (meant for
non-SST)
action was being used as it was passed through cnf file.

Password passed through MYSQL_PWD was completely ignored causing
user-name/password mismatch.

Solution:
---------

* If user has specified credentials for SST then pass them through
command
    line so that they are used in priority.

(There could be security concern on passing things through command
line but
   when I tried passing user-name and password through command line to
mysql
   client and then did ps I saw this
   ./bin/mysql --user=sstuser --password=x xxxxxxxx -S /tmp/n1.sock
so seems like password is not shown)
2016-02-23 21:44:32 -05:00
Nirbhay Choubey
ab9a488dec MDEV-9141 : [PATCH] Add CA validation to wsrep_sst_xtrabackup-v2.sh
- Add CA validation to wsrep_sst_xtrabackup-v2.sh.
- Also added a few {} around tpem for consistency.
- Abort if encryption is requested but socat is not ssl-enabled.

Patch contributed by : Klaas Demter
2015-12-20 19:24:03 -05:00
Sergei Golubchik
7f19330c59 Merge branch 'github/10.0-galera' into 10.1 2015-11-19 17:48:36 +01:00
Nirbhay Choubey
fa5f18d673 Merge branch '5.5-galera' into 10.0-galera 2015-09-09 20:51:39 -04:00
Alexey Yurchenko
a7ea3ec34d Synced xtrabackup SST fixes from Percona tree (as of PXC 5.6.24-25.11 release). This fixes/adresses the following LP bugs:
- LP1380697: wsrep_sst_xtrabackup-v2 doesn't stop when mysql is SIGKILLed. (full fix for this (as engineeered by Percona) requires Linux-specific patch that we don't carry, but keep xtrabackup scripts as close as possible)
  - LP1399134: Log the innobackupex/SST logs in SST to syslog if possible. (fixed)
  - LP1405668: Race condition between donor and joiner in PXB SST. (fixed)
  - LP1405985: Fail early if xtrabackup_checkkpoints is missing. (fixed)
  - LP1407599: wsrep_sst_xtrabackup-v2 script causes innobackupex to print a false positive stack trace into the log. (fixed)
  - LP1441762: IST Fails with SST script error. (fixed)
  - LP1451670: Fail when move-back fails in xtrabackup SST. (fixed)
2015-09-09 17:03:23 -04:00
Alexey Yurchenko
d78110e7fa Refs codership/mysql-wsrep#141: this commit
1. Passes wsrep_sst_auth_value to SST scripts via WSREP_SST_OPT_AUTH envronmental variable, so it never appears on the command line
  2. In mysqldump and xtrabackup* SST scripts which rely on MySQL authentication, instead of passing password on the command line, SST script sets MYSQL_PWD environment variable, so that password also never appears on the mysqldump/innobackupex command line.
2015-09-09 17:02:26 -04:00
Nirbhay Choubey
dced5146bd Merge branch '10.0-galera' into 10.1 2015-07-14 16:05:29 -04:00
Nirbhay Choubey
5467b12dc3 MDEV-7903 : xtrabackup SST failing with maria-10.0-galera
Remove master-bin.state file on joiner node during SST.
2015-06-24 23:28:42 -04:00
Nirbhay Choubey
3eb8bc01b6 Merge branch '5.5-galera' into 10.0-galera 2015-05-14 21:53:48 -04:00
Nirbhay Choubey
8fdf8f00c7 mysql-wsrep#38 : wsrep_sst_xtrabackup-v2 script causes innobackupex to
..print a false positive stack trace into the log

Suppress the stacktrace that innobackupex dumps on receiving SIGPIPE.
2015-05-14 14:25:02 -04:00
Philip Stoev
7d550c76be LP1378355 - Pass the value of --defaults-group-suffix to xtrabackup during SST 2015-05-08 17:41:05 -04:00
Alexey Yurchenko
14b6172075 Going more MTR-friendly - for SST prefer to use mysql client, mysqldump and my_print_defaults from the local build tree. 2015-05-08 17:41:04 -04:00
dirtysalt
9fdae3eb60 Refs #8: preserve gvwstate.dat for pc recovery feature 2015-05-08 17:41:03 -04:00
Alexey Yurchenko
822c00536d Going more MTR-friendly - for SST prefer to use mysql client, mysqldump and my_print_defaults from the local build tree. 2015-05-04 13:04:51 -04:00
dirtysalt
51744b3f80 Refs #8: [5.5] preserve gvwstate.dat for pc recovery feature 2015-05-04 13:04:51 -04:00
Nirbhay Choubey
34d86ac9ff MDEV-6594: Use separate domain_id for Galera transactions 2015-02-27 22:33:41 -05:00
Sergei Golubchik
8e7649867f Merge 10.0-galera into 10.1 2015-02-06 16:14:23 +01:00
Nirbhay Choubey
abf400e810 MDEV-6771 : Incorrect Size for Transfer Reported to pv
xargs may split the input and execute them in batches for
large number of files. As a result xtrabackup sst script
may feed incorrect size to pv.
Fixed by piping the files to du directly (du --files0-from=-).

[Based on suggestions from Brad Jorgensen]
2015-01-13 13:12:05 -05:00
Nirbhay Choubey
33b4fab867 MDEV-6771 : Incorrect Size for Transfer Reported to pv
xargs may split the input and execute them in batches for
large number of files. As a result xtrabackup sst script
may feed incorrect size to pv.
Fixed by piping the files to du directly (du --files0-from=-).

[Based on suggestions from Brad Jorgensen]
2015-01-13 13:10:07 -05:00
Sergei Golubchik
4bb49d84a9 correct handling on defaults[-extra]-file is SST scripts
pass --defaults-file and --defaults-extra-file
(whatever was specified, or none)
from mysqld down to SST scripts.

parse these options in SST scripts and pass them down
to mysqldump, my_print_defaults, and xtrabackup
2014-10-01 23:38:27 +02:00
Jan Lindström
df4dd593f2 MDEV-6247: Merge 10.0-galera to 10.1.
Merged lp:maria/maria-10.0-galera up to revision 3879.

Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
2014-08-26 15:43:46 +03:00
Nirbhay Choubey
c29cbac2eb bzr merge -r3985..3997 codership/5.5 2014-06-10 17:00:32 -04:00
Nirbhay Choubey
0b98d2fd2a bzr merge -r4065..4088 codership/5.6 2014-05-21 17:07:17 -04:00
Nirbhay Choubey
81a85ad8d7 bzr merge -r3985..3991 codership/5.5 2014-05-21 15:04:13 -04:00
Jan Lindström
fa18dc3944 Merge lp:codership-mysql/5.5 -r3961..3980. 2014-04-16 13:08:29 +03:00
Nirbhay Choubey
b5871a51e9 * bzr merge -r4027..4061 codership/5.6
* Merged Innodb changes to xtradb
2014-03-26 11:12:38 -04:00
Nirbhay Choubey
899f9801d4 bzr merge -r3946..3968 codership/5.5 2014-03-25 17:01:05 -04:00