Avoiding SST when adding new Percona XtraDB Cluster node

Some people want to use a backup to prepare a new Percona XtraDB Cluster node. They want this to avoid State Snapshot Transfer that could slow down the donor (depending of the SST method you are using, the donor can be blocked. I will cover this in a future blog post). As backup are generally performed during non-peak time, the effect should be reduced, and this avoid the need of performing 2 backups: the usual backup and the SST).

So to be able to use a backup for this purpose, we have 3 prerequisites:

  • use XtraBackup >= 2.0.1
  • the backup needs to be performed with –galera-info (option for innobackupex)
  • have a gcache big enough to store all the changes from the time of the backup until the restore to be able to perform the Incremental State Transfer (IST) gcache.size cannot be changed during runtime but needs to be defined in my.cnf. This change requires a restart of mysql.
  • provide the ist.recv_addr (ex: wsrep_provider_options = “ist.recv_addr=;”) if you don’t use yet the magic wsrep_node_address variable (see below)

Once you have your backup, you should now see a file called xtrabackup_galera_info. The file contains the local node state at the time of the backup.

So when you have restored the backup, you can notice that you don’t have the file grastate.dat in the datadir (or you have an old one if this is not a fresh node).
The trick is to modify this file with the information fetched during the backup.

For example, if we have in xtrabackup_galera_info the following content:


We will need to edit grastate.dat as follow:

The version in grastate.dat comes from the global variable wsrep_provider_version:

After that you will be able to start the node and see in the donor that IST is used to populate the new node. You can see it in the logs:

and on the new node :

PS1: you can change the size of gcache in my.cnf using the following syntax:


PS2: using wsrep_node_address is the recommended way to define on which address lives a PXC node.
You can then avoid to specify wsrep_sst_receive_address, wsrep_node_incoming_address and ist.recv_addr that are very common in PXC configuration.

Share this post

Comments (6)

  • torrent indir

    tenx for information

    July 3, 2013 at 3:07 pm
  • gphilip

    Thanks, very useful info. Is it possible that xtrabackup_galera_info is not generated in case of a partial backup (using –include)?

    October 24, 2013 at 6:05 pm
  • yemekler burda

    Thank you for the information, I’m looking for

    November 15, 2013 at 7:45 am
  • Morten Isaksen

    Thank you for this article.

    One hint. Remember when you have created the grastate.dat file to make it writeable for the mysql user. I think this error was the reason my first attempt did not work.

    May 14, 2014 at 2:48 pm
  • Spin0us

    Thank you for this article.

    I just have a kernel panic on one of my 3 nodes cluster and try your method to restore the crash node.
    But it still do the State Snapshot Transfert that slow down the donor.
    What’s wrong ?

    September 16, 2014 at 5:26 pm
  • hongtao

    can we do the back from pxc cluster slave?

    September 12, 2016 at 5:37 am

Comments are closed.

Use Percona's Technical Forum to ask any follow-up questions on this blog topic.