In the data synchronization phase of Greenplum Disaster Recovery, you:

  • Bootstrap the recovery cluster
  • Keep the recovery cluster in sync with the primary cluster
  • Perform backup-related tasks
  • Display information about backups and restore points

Bootstrap the Recovery Cluster

To bootstrap the recovery cluster, you take a full backup of the primary cluster and restore on the recovery cluster.

Take a Full Backup on the Primary Cluster

Before you begin, be sure you have configured the primary cluster. Review the Preparation Tasks topic for details.

To take a full backup, run the following command:

gpdr backup --type full

Restore on the Recovery Cluster

You can perform one of two types of recovery: full or incremental; the type you choose depends on whether GPDR used an existing cluster or spun up a new one when it set up the recovery cluster.

  • If GPDR used an existing cluster, you must do an incremental restore
  • If GPDR spun up a new cluster, you do a full restore

Full Restore

Run the following command:

gpdr restore -t full --restore-point { <restore_point> | latest }

Incremental Restore

Run the following command:

gpdr restore -t incr --restore-point { <restore_point> | latest }

Keep the Recovery Cluster in Sync with the Primary Cluster

Once you have bootstrapped the recovery cluster, you will need to keep it in sync with primary cluster on an ongoing basis.

How you do this depends on whether you are performing an incremental workflow or a continuous workflow. To review the basics of each workflow type, see the Workflows topic,

If Incremental Workflow

In an incremental workflow, you take periodic incremental backups and restore them. You may also choose to take full backups and expire the all but the latest full backup as needed.

A typical cadence could be taking incremental backups once a week, but you may choose to do this more or less often, depending on how much traffic is hitting the cluster.

  1. Take an incremental backup:

    gpdr backup --type incr
    
  2. Restore this backup:

    gpdr restore -t incr --restore-point { <restore_point> | latest }
    

If you choose to take full backups, then:

  1. Take a full backup

    gpdr backup --type full
    
  2. Restore the full backup, using the --incr option.:

    gpdr restore -t incr --restore-point { <restore_point> | latest }
    

If Continuous Workflow

In a continuous workflow, the cadence of creating restore points is frequent, as often as once every hour.

Recall that:

You may also choose to take full backups as part of a continuous workflow, and expire them as needed; however, at least one backup needs to exist

  • In a continuous workflow, once you have a backup, you may keep creating restore points so that GPDR can replay on the recovery cluster the WAL associated with that restore point

  • Every backup results in an implicit restore point

  • When you create an explicit restore point, GPDR associates it with the most recent backup

Follow these steps for continuous workflow:

  1. Create a restore point:

    gpdr create-restore-point 
    
  2. Restore this restore point

    gpdr restore -t continuous --restore-point { <restore_point> | latest }
    

Monitor Progress of Backups

Run gpdr monitor backup to view the progress of an ongoing backup for all segments, including the coordinator.

List Backups and Restore Points

Greenplum disaster recovery allows you to:

  • List backups
  • List the restore points

You may list backups and restore points from either the primary or the recovery cluster.

For both backups and restore points, you list in order to:

  • verify the state of the repository
  • review what is available to restore and choose from that list
  • review what is available to expire and choose from that list in order to save storage space

To list backups:

gpdr info backup [--after-timestamp <string>] [--before-timestamp <string>] [--detail]

To list a backup's associated restore points:

gpdr info backup --format restore-points [--after-timestamp <string>] [--before-timestamp <string>] [--detail] 
Note

When listing a backup's associated restore points, you must pass the restore-points string to the --format option. As the value of --format defaults to backups you need not pass it when listing backups.

Display Information about Most Recent Successful Restore

GPDR allows you to display information about the most recent successful restore -- that is, the most recent restore point restored to the recovery cluster. You display this information with the gpdr info restore command.

Note

You may run gpdr info restore from the recovery cluster only.

The gpdr info restore command yields the following information:

  • The restore type (full, incremental, or continuous)
  • The name of the restore point
  • The backup label
  • The time the restore started
  • The time the restore stopped
  • If the recovery cluster has not yet been promoted, this command also displays the latest archived WAL and the last replayed WAL for the restore point, and the lag, -- in number of files -- between files replayed and files archived, by segment

Expiring Backups and Restore Points

To conserve storage space, you may need to expire a backup or restore points, with the gpdr expire command.

Note

The only difference between expiring backups and expiring restore points, is that when you expire backups you also expire physical backup data.

  • Expiring a backup deletes the following:

    • the actual physical data associated with the backup
    • the WAL archive and restore points associated with the backup
    • the WAL archive, restore points, and physical data associated with any incremental backups underlying this backup
  • Expiring restore points deletes the following:

  • the WAL archive and restore points associated with the backup

  • the WAL archive and restore points associated with any incremental backups underlying this backup

Choosing between these two commands largely hinges on which GPDR workflow you're using: incremental or continuous. Because incremental workflow results in a larger number of backup files than a continuous workflow, you will likely expire backups, rather than restore points, if you are employing an incremental workflow.

For details on the differences between incremental and continuous workflows, see the Workflows topic.

Expire Backups

Consider the incremental workflow depicted in the following diagram:

Incremental Workflow Scenario

During the time period captured in the diagram above, the user peforms two full backups and three incremental backups; each of these backups creates an implicit restore point. In addition, the user creates six explicit restore points (rp1 through rp6).

In this scenario:

If you expire Full Backup 1, it will expire:

  • Full Backup 1
  • Incr Backup 1
  • Incr Backup 2
  • All restore points up until rp4

If you expire Incr Backup 1, it will expire:

  • Incr Backup 1
  • Incr Backup 2
  • All restore points up until rp4

Expire Restore Points

Consider the continuous workflow depicted in the following diagram: ​ Continuous Workflow Scenario

In this scenario, if you expire the restore associated with Full Backup 1, it will expire restore points rp1 through rp7.

Important

Running gpdr expire restore-points only expires explicit restore points.

Deciding Between Data Safety and Storage

When you expire a backup or restore points, you must pass the either the --dr-restore-point option OR the --force option to the command. GPDR's handling of these options varies, depending on whether you are expiring backups or expiring restore points.

When you invoke the --dr-restore-point option, you pass in the restore point of the most recent restore in the recovery cluster. GPDR then evaluates whether it is safe to expire the specified backup and the associated WAL and restore points; that is, whether doing so would prevent properly executing a continuous restore.

Choose the --dr-restore-point option if data safety is more important to you than conserving storage. Choose the --force option is conserving storage is more important than losing some data.

When Expiring Backups

If the value of --dr-restore-point precedes the last restore point of the backup specified by --backup-level, then expiring the backup is not safe and GPDR will error out, because you might unintentionally delete WAL files that are required for future restores.

When passed the --force option, GPDR deletes the backup and the restore points associated with that backup, as well as underlying incremental backups and associated restore points, without evaluating for data safety.

When Expiring Restore Points

If the value of --dr-restore-point precedes the implicit restore point of the backup specified by --backup-level, then expiring the restore point is not safe and GPDR will error out, because you might unintentionally delete WAL files that are required for future restores.

GPDR expires restore points only up to the value of --dr-restore-point; the restore point specified by --dr-restore-point is not deleted.

When passed the --force option, GPDR deletes the restore points associated with the backup without evaluating for data safety.

Note

The restore points of the most recent backup cannot be deleted, even if the --force option is invoked.​ GPDR imposes this restriction to ensure that continuous restore functions correctly.

check-circle-line exclamation-circle-line close-line
Scroll to top icon