In Postgres-XC, all the user data is stored at datanodes. Because they are separate database in principle, we should backup and restore each datanode separately. In restore, it is essential to synchronize the restoration point among all the datanodes to maintain database integrity over the whole database cluster.
CREATE BARRIER defines this restoration point. You can specify a barrier id as a restoration point in recovery.conf file of each datanode when you restore all the datanodes.
Here, we need to take care of GTM status. To restart restored XC cluster, we need to supply appropriate status of the transaction and sequences to GTM. To do this, we need to backup GTM restart data for each barrier.
As a default, XC does not take care of GTM restart point for specific barrier. To enable this, you need to set gtm_backup_barrier GUC parameter to on as:
# SET GTM_BACKUP_BARRIER TO ON; # CREATE BARRIER 'b1';
Then, in the same session, if you issue CREATE BARRIER command, you will have GTM restart point backup at GTM working directory. The file name is GTM_xxx.control, where xxx is the barrier id.
When you've done all the restoration, you should start GTM with the backup file You can specify this file with -C option as:
$ gtm_ctl start -C GTM_b1.control -D your_path ...