Galera Cluster – Does rsync Only Update Changed Files?

galerareplication

We're currently setting up a galera cluster using rsync for sst.

The datadir is currently 20Gig and right now we're only updating about 4 (very large) tables.

I know that rsync normally only transfers file changes also that galera has rsync setup to ignore timestamps.

If we start sst, does rsync transfer the whole 20gig or only the files for the tables that have been updated?

Thanks

Best Answer

From what I can tell it looks like it will usually transfer the whole file instead of using the delta-xfer algorithm unless you set the wsrep_sst_rsync_wan option. I assume this is because on a local network transferring the full file is close enough or as fast as calculating the deltas between the files. The relevant lines in the SST script for MariaDB 10.0.14 galera is below.

# Use deltaxfer only for WAN
inv=$(basename $0)
[ "$inv" = "wsrep_sst_rsync_wan" ] && WHOLE_FILE_OPT="" \
                                       || WHOLE_FILE_OPT="--whole-file"