[DOC] cpat example for xtrabackup-v2 breaks the SST
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Confirmed
|
Low
|
Unassigned | |||
5.6 |
Confirmed
|
Low
|
Unassigned |
Bug Description
https:/
https:/
The example regex presented there leads to .sst directory removal when the SST already started using it. The wsrep_sst_
+ mkdir -p /opt/data/
+ jpid=20385
+ ps -p 20106
+ recv_joiner /opt/data/
+ local dir=/opt/
+ local msg=Joiner-Recv-SST
+ local tmt=0
+ local ltcmd
+ pushd /opt/data/
(...)
+ find /opt/data/mysql/ -mindepth 1 -regex '.*galera\
removed directory: `/opt/data/
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/
removed `/opt/data/
(...)
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\
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:
[root@pxc552 ~]# mkdir /opt/data/
[root@pxc552 ~]# find /opt/data/mysql/ -mindepth 1 -regex '.*galera\
/opt/data/
/opt/data/
/opt/data/
/opt/data/
/opt/data/
/opt/data/
An example of fixed regex:
[root@pxc552 ~]# find /opt/data/mysql/ -mindepth 1 -regex '.*galera\
/opt/data/
/opt/data/
/opt/data/
/opt/data/
/opt/data/
/opt/data/
/opt/data/
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.
One correction, the cpat option is used to actually modify the default exclusion regex. When cpat is not explicitly set, xtrabackup-v2 uses this one:
+ find /opt/data/mysql/ -mindepth 1 -regex '.*galera\ .cache$ \|.*sst_ in_progress$ \|.*\.sst$ \|.*gvwstate\ .dat$\| .*grastate\ .dat$\| .*\.err$ \|.*\.log$ \|.*RPM_ UPGRADE_ MARKER$ \|.*RPM_ UPGRADE_ HISTORY$ ' -prune -o -exec rm -rfv '{}' +