Details
-
Bug
-
Status: On Hold
-
Low
-
Resolution: Unresolved
-
None
-
None
-
None
Description
**Reported in Launchpad by Przemek last update 20-11-2015 09:15:16
https://www.percona.com/doc/percona-xtradb-cluster/5.5/manual/xtrabackup_sst.html#cpat
https://www.percona.com/doc/percona-xtradb-cluster/5.6/manual/xtrabackup_sst.html#cpat
The example regex presented there leads to .sst directory removal when the SST already started using it. The wsrep_sst_xtrabackup-v2 debug mode output fragment:
+ mkdir -p /opt/data/mysql//.sst
+ jpid=20385
+ ps -p 20106
+ recv_joiner /opt/data/mysql//.sst Joiner-Recv-SST 0
+ local dir=/opt/data/mysql//.sst
+ local msg=Joiner-Recv-SST
+ local tmt=0
+ local ltcmd
+ pushd /opt/data/mysql//.sst
(...)
+ find /opt/data/mysql/ -mindepth 1 -regex '.galera\.cache$|.*sst_in_progress$|.*grastate\.dat$|.\.err$|.\.log$|.*RPM_UPGRADE_MARKER$|.*RPM_UPGRADE_HISTORY$|.\.xyz$' -prune -o -exec rm -rfv '{}' +
removed directory: `/opt/data/mysql/.sst'
And following error on the joiner node:
WSREP_SST: [INFO] Cleaning the existing datadir and innodb-data/log directories (20150915 07:32:56.599)
removed directory: `/opt/data/mysql/.sst'
removed `/opt/data/mysql/performance_schema/events_waits_history.frm'
(...)
WSREP_SST: [INFO] Waiting for SST streaming to complete! (20150915 07:32:56.661)
^Gxbstream: Can't create/write to file '././backup-my.cnf' (Errcode: 2 - No such file or directory)
xbstream: failed to create file.
2015/09/15 07:33:08 socat[19593] E write(1, 0x13af440, 1815): Broken pipe
in my.cnf:
[sst]
cpat ='.galera\.cache$|.*sst_in_progress$|.*grastate\.dat$|.\.err$|.\.log$|.*RPM_UPGRADE_MARKER$|.*RPM_UPGRADE_HISTORY$|.\.xyz$'
The regex above is meant to list the files and directories, that should NOT be removed during SST, while the result does not work for .sst:
[[email protected] ~]# mkdir /opt/data/mysql/.sst
[[email protected] ~]# find /opt/data/mysql/ -mindepth 1 -regex '.galera\.cache$|.*sst_in_progress$|.*grastate\.dat$|.\.err$|.\.log$|.*RPM_UPGRADE_MARKER$|.*RPM_UPGRADE_HISTORY$|.\.xyz$'
/opt/data/mysql/RPM_UPGRADE_HISTORY
/opt/data/mysql/innobackup.move.log
/opt/data/mysql/innobackup.prepare.log
/opt/data/mysql/pxc552_error.log
/opt/data/mysql/grastate.dat
/opt/data/mysql/galera.cache
An example of fixed regex:
[[email protected] ~]# find /opt/data/mysql/ -mindepth 1 -regex '.galera\.cache$|.*sst_in_progress$|.*grastate\.dat$|.\.err$|.*\.log$|.*RPM_UPGRADE_MARKER$|.*RPM_UPGRADE_HISTORY$|.*sst$'
/opt/data/mysql/.sst
/opt/data/mysql/RPM_UPGRADE_HISTORY
/opt/data/mysql/innobackup.move.log
/opt/data/mysql/innobackup.prepare.log
/opt/data/mysql/pxc552_error.log
/opt/data/mysql/grastate.dat
/opt/data/mysql/galera.cache
In addition to fix the regex, this sentence needs to be corrected: "This option provides the ability to define the files that need to be deleted before the SST." The true meaning is that it defines the files that need to be excluded from deletion.