When having datadir pointing at a symbolic link to the actual data directory instead of the data directory itself an SST attempt using the mariabackup method fails on the --move-back step as the data directory still contains files like "ibdata1".
Looks as if the data directory purging step early in the SST workflow fails to detect that there are actual files still present in the data directory, wrongly interpreting a symbolic link as an empty directory.
How to reproduce:
- Install a node without wsrep settings at first
- shut down the node
- move its datadir from /var/lib/mysql to e.g. /data/mysql
- make /var/lib/mysql a symlink to /data/mysql
- do not change datadir=... yet
- add galera specific wsrep_* settings, using mariabackup as SST method
- start up the node
The node will start to perform a SST, but will fail at the mariabackup --move-back step with e.g.:
This seems to have started with MariaDB 10.3, with 10.2 I can see the datadir being purged and SST succeeding even when using a symlink for datadir