On Fri, May 25, 2012 at 4:12 PM, Gea-Suan Lin wrote:
> 1. When node2 shutdown, and then back, sometimes I'll see node2 needs to run
> rsync with node1. Is this behavior correct ?
Yes. If there were only a few changes on node1, then node2 can request
Incremental State Transfer and just copy those changes and catch up.
If there were too many changes on node1, then node2 will request a
full State Snapshot Transfer, which in your case is configured to use
rsync. It takes a full copy of the node1 database.
> 2. As 1. question, when node1 & node2 running rsync to sync data, do both
> read and write operations be blocked ?
For rsync, yes. To fix:
Use more than 2 nodes, then you will still have one left that is not blocked.
or
In Percona XtraDB Cluster, you can use xtrabackup for sst method. (I
haven't used it, but it might work just by changing
wsrep_sst_method=xtrabackup). Xtrabackup is a non-blocking way of
copying the database, so node1 will be able to continue to operate.
On Friday, May 25, 2012 4:45:23 PM UTC+3, Henrik Ingo wrote:On Fri, May 25, 2012 at 4:12 PM, Gea-Suan Lin wrote:
> 1. When node2 shutdown, and then back, sometimes I'll see node2 needs to run
> rsync with node1. Is this behavior correct ?
Yes. If there were only a few changes on node1, then node2 can request
Incremental State Transfer and just copy those changes and catch up.
If there were too many changes on node1, then node2 will request a
full State Snapshot Transfer, which in your case is configured to use
rsync. It takes a full copy of the node1 database.
The point at which SST becomes needed depends on the gcache.size Galera option. By default it is 128M, which may be not so much for the hardware like this. For example setting
wsrep_provider_options="gcache.size=10G"
should be more appropriate for the database of such size and reduce the number of occurrences when full SST is needed.
> 2. As 1. question, when node1 & node2 running rsync to sync data, do both
> read and write operations be blocked ?
For rsync, yes. To fix:
Use more than 2 nodes, then you will still have one left that is not blocked.
or
In Percona XtraDB Cluster, you can use xtrabackup for sst method. (I
haven't used it, but it might work just by changing
wsrep_sst_method=xtrabackup). Xtrabackup is a non-blocking way of
copying the database, so node1 will be able to continue to operate.
yes, wsrep_sst_method=xtrabackup shall do the trick but you also need to install Xtrabackup 2.0 for that. Also note that even though it is non-blocking on donor, datadir recovery on joiner will still take quite a lot of time (yet I found that it can be quite faster than recovery after rsync).